Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Automation

Status
Not open for further replies.

pobrien1

Programmer
Sep 3, 2001
1
GB
Hi

I am trying to call an Active X DLL(written in Visual Basic) from an extended stored procedure.

I can create the object token OK.

When I try to call a method as follows (i.e. Connect to a DB using ADODB) using the following command

EXEC @hr = sp_OAMethod @object, 'ConnectDb', @returnval OUT, '<servername>', '<system dsn>', True, '<username>', '<password>'

I get the following error message:
hr=0x80020005
Source= ODSOLE Extended Procedure
Description =Type Mismatch

It may be something to do with the returnval of the method??

This is the method in the DLL that I am trying to execute:

Public Function ConnectDb(sServer As String, sDataSource As String, bIntegratedSecurity As Boolean, sUser As String, sPassword As String) As Boolean


Has anyone got any ideas?

Ta
Patricia

PS. I have already proven that this function can be called from a VB program but I really need to call this from a stored procedure!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top