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!
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!