Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sp_OACreate out-of-process in SQL 2000

Author  Topic 

kevin.post
Starting Member

2 Posts

Posted - 2004-02-19 : 11:09:45
I've been using ASPQMail (SMTPsvg.dll) to send mail from SQL 7 in a production environment for over a year. I encountered some problems with memory management that caused the SQL Server service to hang. I corrected the problem by creating the instance of the mailer object outside of SQL Server. (Microsoft Knowledge Base Article - 198891).

I am in the process of upgrading/replacing that application with a new version that runs on SQL 2000. I've moved the stored procedures related to sending mail to SQL 2000 but it will not run. It fails at:

EXEC @AspMail=sp_OACreate 'SMTPsvg.Mailer', @pObj OUTPUT, 4

It will, however, work 'in process' if I change the code to:

EXEC @AspMail=sp_OACreate 'SMTPsvg.Mailer', @pObj OUTPUT, 1

The KB article (198891) instructs the reader to set the DLLSurrogate path to 'DLLSurrogate' works fine in SQL 7.0 but fails with a 'File not found' error. So, I set the DLLSurrogate to 'C:\WINNT\System32\DLLHost.exe' whereupon execution of the SQL code, the process hangs or produces a 'Server execution failed' error. As instructed by the article, I've triple-checked the Security settings in the registry to allow full control permissions.

This code runs consistently on all of my SQL 7 servers and fails consistently on every SQL 2000 server.

Any helpful suggestions would be appreciated.

-Kevin

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-02-19 : 13:22:27
One work-around (aka. HACK) option would be to create a wrapper .EXE file which exposes the properties and methods of ASPQMail and call that wrapper from sp_oa with a context of 4.
Go to Top of Page

kevin.post
Starting Member

2 Posts

Posted - 2004-02-19 : 13:34:01
Thanks for the reply...

Further research and attempts has shown that I am not able to use sp_OACreate to instantiate any COM object out of process using a context of 4. This includes .exe and .dll based objects.

Through searches of various resources, this appears to be an issue for a number of people with SQL 2000 SP3 and later.

-Kevin
Go to Top of Page
   

- Advertisement -