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 problem

Author  Topic 

cristipopescu2005
Starting Member

4 Posts

Posted - 2005-12-06 : 10:23:32
Hi,
I am using the sp_OACreate extended stored procedure to instantiate a COM object.

Since my script is within a sql job which is scheduled to run at every 5 minutes, the sp_OACreate is called very often.

The problem is that after about a week of running, the sp_OACreate procedure crashes and returns this error message : "ODSOLE: Dynamic library initialization failed."

It looks like restarting the SQL Server service fixes the problem, but only for another week, after which the same error occurs.

Does anyone know how to overcome this situation ? Is this a bug of SQL Server or of the ODSOLE70.dll (which is the implementation of the sp_OACreate extended stored procedure) ?

Thanks,
Cris

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-12-06 : 10:30:22
Did the COM object change? What COM object are you creating?

Go to Top of Page

cristipopescu2005
Starting Member

4 Posts

Posted - 2005-12-06 : 10:46:21
No, the COM object did not change. This COM is using the FileSystemObject to read file names from a folder on the local machine.

However, I could successfully instantiate the COM object using the test.exe while the sp_OACreate failed.

The sp_OACreate fails as well while trying to create a different COM.

quote:
Originally posted by jsmith8858

Did the COM object change? What COM object are you creating?



Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-12-06 : 10:56:53
How about showing us some code? And the error message might be helpful as well.

Also -- I know that by default many SQL accounts do not have the rights to execute sp_OACreate; did the SQL Server account used to execute this process change in the last week?
Go to Top of Page

cristipopescu2005
Starting Member

4 Posts

Posted - 2005-12-06 : 11:20:52
The SQL Server account used to execute this process has not changed.
No changes were performed on the sql server side, no permission changes.
After a restart of the sql server service it starts working correctly, for a while. Sometimes, after a few failures it works correctly without restarting the sql service.

The code is:


Declare @iMsg int
Declare @hr int

EXEC @hr = sp_OACreate 'MyProject.MyClass', @iMsg OUT
EXEC @hr = sp_OAMethod @iMsg, 'Execute', NULL
EXEC @hr = sp_OADestroy @iMsg



quote:
Originally posted by jsmith8858

How about showing us some code? And the error message might be helpful as well.

Also -- I know that by default many SQL accounts do not have the rights to execute sp_OACreate; did the SQL Server account used to execute this process change in the last week?

Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-12-06 : 11:28:45
>>EXEC @hr = sp_OACreate 'MyProject.MyClass', @iMsg OUT

You just said that your code was creating a filesystem object. I understand how sp_OACreate *works*, you don't need to provide an *example*! How about showing the actual code and the actual error message? Don't you think that it might be a little bit helpful? How else am I supposed to be able to help you?
Go to Top of Page
   

- Advertisement -