Home All Groups Group Topic Archive Search About
Author
27 Jul 2006 4:08 PM
Everton
Hi, I have a COM Object at my Server and when I export this COM as Proxy and
Install in another server,  the sp_AOMethod raise a error message.

If a execute the code in my local server, ok, but when execute the code  in
my client server, the error message is raised.    Somebody can help me?

The error message is:
sp_OAMethod usage:  ObjPointer int IN, MethodName varchar IN [, @returnval
<any> OUT [, additional IN, OUT, or BOTH params]]


My Code is:
declare @source varchar(50)
declare @ret varchar(100)
declare @description varchar(200)
declare @obj int
declare @hr int
declare @x smallint
select @x=10
exec sp_oacreate 'COM.ClasseCom',@obj output , 4
exec @hr=sp_oamethod @obj,'funcionar',@ret output
IF @hr <> 0
BEGIN
EXEC @hr = sp_OAGetErrorInfo @obj, @source OUT, @description OUT
select @source
select @description
RETURN
end
else
select @ret
exec sp_oadestroy @obj

Author
27 Jul 2006 10:25 PM
Erland Sommarskog
Everton (proje***@yahoo.com.br) writes:
Show quote
> Hi, I have a COM Object at my Server and when I export this COM as Proxy
> and Install in another server,  the sp_AOMethod raise a error message.
>
> If a execute the code in my local server, ok, but when execute the code
> in my client server, the error message is raised.    Somebody can help
> me?
>
> The error message is:
> sp_OAMethod usage:  ObjPointer int IN, MethodName varchar IN [, @returnval
><any> OUT [, additional IN, OUT, or BOTH params]]
>
>
> My Code is:
> declare @source varchar(50)
> declare @ret varchar(100)
> declare @description varchar(200)
> declare @obj int
> declare @hr int
> declare @x smallint
> select @x=10
> exec sp_oacreate 'COM.ClasseCom',@obj output , 4

You don't check the outcome of sp_OAcreate. I bet that you fail to
create the object for some reason.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button