I was trying to do this recently and the concensus is that you can't - VB doesn't povide the correct interface. You can create VB dlls and call them through ODBC using the spOA_ stored procedures. These are well documented in Books Online with samples.
I am getting errors.
"Error Occurred Calling Object: ODSOLE Extended Procedure
sp_OADestroy usage: ObjPointerToBeDestroyed int IN."
This is what I did
Step1
'created a DLL for the following function
Public FirstNumber As Variant
Public SecondNumber As Variant
Function AdditionFunction(FirstNumber, SecondNumber)
AdditionFunction = FirstNumber + SecondNumber
Print AdditionFunction
End Function
Step2
Registered the Dll
regsvr32 d:\mydll\additionfunction.dll
Step3
'Execute this script
DECLARE @cInputValue1 int
DECLARE @cInputValue2 int
DECLARE @cOutputValue int
DECLARE @objDLL int
declare @Hresult int
DECLARE @ErrorSource varchar (255)
DECLARE @ErrorDesc varchar (255)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.