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)
 Problem accessing a DLL from a stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-07 : 08:38:27
Raj writes "I am trying to access a DLL from a stored procedure.The method in the DLL takes 3
parameters as input and returns a boolean value.I got the following error
"0x80020006 ODSOLE Extended Procedure Unknown name". When I tried this
code.



DECLARE @object int
DECLARE @hr int
DECLARE @property varchar(255)
DECLARE @x int
DECLARE @src varchar(255)
DECLARE @desc varchar(255)

-- Create an object.
EXEC @hr = sp_OACreate 'Calendaring.CalendarCalc', @object OUT
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

-- Call a method that returns a value.
EXEC @hr = sp_OAMethod @object, 'IsHoliDay',@x OUTPUT,'20041225','CalendarName','c:\config.ini'
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END
PRINT @x

-- Destroy the object.
EXEC @hr = sp_OADestroy @object
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

Any help would be appreciated
Thanks in advance."
   

- Advertisement -