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)
 SQL COM not working - Please help!

Author  Topic 

ppuar
Starting Member

28 Posts

Posted - 2001-11-05 : 14:29:06
I have the following stored procedure

CREATE PROC icsDNSLookup
@IPAddress varchar(255),
@HostName varchar(1000) = null output

as

BEGIN
declare @object int

exec sp_OACreate 'WebResolve.WebResolve', @object out
exec sp_OASetProperty @object, 'Host', '192.168.0.73'
exec sp_OAMethod @object, 'Resolve'
exec sp_OAGetProperty @object, 'Host', @HostName out
exec sp_OADestroy @object

end
GO
GRANT EXECUTE ON icsDNSLookup TO public
go

----------------------------------------

When I run the following command in sql query tool, the stored procedure works and resolves my ip address

declare @temp varchar(255)

exec icsDNSLookup '192.168.0.73', @HostName = @temp output

print @temp

result - www.google.com

However if I run this proc from ASP it returns the ip address back?

What am I doing wrong?

p

   

- Advertisement -