COM remoting in SQL 2000

  • 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

  • This was removed by the editor as SPAM

  • I thought I would post this for everyone's benefit...

    My research indicates that any attempt to use sp_OACreate with a context of 4 (out of process) will fail in SQL Server 2000 SP3 and after.  I first found it in messages on Google and other forums.  I tried for myself and confirmed the problem.  I was not able to instantiate any objects out-of-process using spOACreate.

    The solution offered by Microsoft Knowledge Base Article - 198891 works great in SQL 7 but may not bee effective in SQL 2000 SP3 and greater.

    -Kevin

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply