Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 2nd, 2004, 10:12 PM
varun_cal varun_cal is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 varun_cal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy CDO error

Hi,

I am trying to write a stored procedure that will send an email whenever a certain field in the database is changed. I am using CDO procedures for this. Here is my code (abbreviated)

CREATE PROCEDURE dbo.sendMail
@from VARCHAR(100),
@to VARCHAR(100),
@subject VARCHAR(200),
@mBody VARCHAR(1000)
AS
DECLARE @MailID int
DECLARE @err int
DECLARE @sSource int
DECLARE @sDescription VARCHAR(100)
DECLARE @sMsg VARCHAR(200)
EXEC @err = sp_OACreate 'CDONTS.NewMail', @MailID OUT
EXECUTE sp_OAGetErrorInfo @MailID, @sSource OUT, @sDescription OUT
SET @sMsg = ' Error # = ' + CAST(@err AS VARCHAR(20)) + '. Description = ' + @sDescription
RAISERROR (@sMsg, 16, 1)

GO

I call this stored procedure through a trigger that looks like this

CREATE TRIGGER tr_Categories_1 ON [dbo].[Categories]
FOR INSERT, UPDATE, DELETE
AS
IF UPDATE(CategoryName)
BEGIN
EXECUTE sendMail 'xyz@abc.com', 'xyz@abc.com', 'Hi there', 'The field has changed'
END

However, when I update the table I get the following error
Server: Msg 50000, Level 16, State 1, Procedure sendMail, Line 16
Error # = -2147221005. Description = Invalid class string

I am not sure why I am getting this error, and documentation on the internet is not helping.

thanks,
varun

Reply With Quote
  #2  
Old November 2nd, 2004, 11:44 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 32 m 23 sec
Reputation Power: 180
Perhaps CDONTS isn't installed on the server?
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old November 3rd, 2004, 12:35 PM
varun_cal varun_cal is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 varun_cal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Could there be any other reason? I installed CDO yesterday on my computer.

Reply With Quote
  #4  
Old November 3rd, 2004, 03:48 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 32 m 23 sec
Reputation Power: 180
CDO is not CDONTS, and your code is looking for CDONTS. CDONTS comes with the IIS SMTP server in IIS4 and 5, but isn't installed with XP or W2003.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > CDO error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway