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
 Transact-SQL (2000)
 invalid class string

Author  Topic 

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-11-05 : 05:25:34
hello,
I am trying to call a dll from a stored procedure ,it gives me the following error:
Invalid class string

but the same dll works fine when used in a aspx page or in a exe.
any views?
thanks in advance.
regards,
harshal.

The Judgement of the Judge is as good as the Judge.

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-11-05 : 05:35:13
Harshal

How can we help you if you don't show us some code ?
Nobody here is a mind reader.


Damian
Go to Top of Page

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-11-05 : 05:38:08
quote:
Originally posted by Merkin

Harshal

How can we help you if you don't show us some code ?
Nobody here is a mind reader.


Damian


Extremely sorry.
here is the code:
CREATE procedure calldll
as

declare @returnval int
declare @hr int
declare @object int
declare @return varchar(255)
declare @productid int
declare @@delaylength datetime
declare @padurl varchar(100)
declare @src int
declare @desc varchar(1000)
declare @product varchar(10)
DECLARE @@RETURNINFO varchar(255)
begin
set @@delaylength='0:0:20'



--print @productid
declare user_cursor cursor for (select top 1 productid,padurl from tblproddetails where padurl is not null and padmaincat is null)

open user_cursor

fetch next from user_cursor
into @productid,@padurl

while @@fetch_status=0
begin
exec @hr=sp_oacreate 'CPollXML_COMplus.clspollfile' ,@object out
exec sp_oageterrorinfo @object,@src out,@desc out
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
IF @hr <> 0
select 'can not create object'

set @product=convert(varchar(10),@productid)
exec @hr= sp_oamethod @object,'StorePAD',null ,@padurl,@product

EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
IF @hr <> 0
BEGIN
select 'harshal'
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
end
--

WAITFOR DELAY @@DELAYLENGTH
exec @hr=sp_oadestroy @object
--select @returnval
fetch next from user_cursor
into @productid,@padurl
end
close user_cursor
deallocate user_cursor

end








The Judgement of the Judge is as good as the Judge.
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-11-05 : 05:40:53
Is the dll registered on the SQL server machine? This is of course, applicable only if your web server and database server are two different machines.

Owais


Where there's a will, I want to be in it.
Go to Top of Page

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-11-05 : 05:42:27
yes it is registered on the sql server.

The Judgement of the Judge is as good as the Judge.
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-11-05 : 06:16:38
Try this approach (for just to make sure):

declare @object int, @myScript varchar(8000)

set @myScript=
'set complus=createobject("CPollXML_COMplus.clspollfile")' +
char(13)+char(10)+
'.... and so on ....'

sp_OACreate 'MSScriptControl.ScriptControl', @object OUTPUT
sp_OASetProperty @object, 'Language', 'vbscript'
sp_OASetProperty @object, 'Timeout', 30000 -- in secs
sp_OASetProperty @object, 'AllowUI', 0
sp_OAMethod @object, 'ExecuteStatement', NULL, @myScript
sp_OADestroy @object
Go to Top of Page
   

- Advertisement -