Problem with OLE Automation object in SPROC

Problem with OLE Automation object in SPROC

Post by Terry Wigh » Thu, 09 Dec 1999 04:00:00

I'm having a problem with the stored procedure below.
The procedure sp_OAMethod generates an OLE Type Mismatch error 0x80020005.

sp_OACreate and sp_OADestroy return normally without error.

OLE Automation Error Information:
  HRESULT: 0x80020005
  Source: ODSOLE Extended Procedure
  Description:  Type mismatch.

My VB DLL Function prototype looks like this:

Public Function GetDistance(dblLatitude1 As Double, dblLongitude1 As Double,
                            dblLatitude2 As Double, dblLongitude2 As Double)
As Double

When I call the DLL from an ASP page or a VB app it works fine.

Can anyone help? I can't find any specific info on data type
conversions between SQL 7.0 and VB6 that say what I'm doing is wrong.

It looks like Double to float is a valid conversion.






 /* Create OLE Automation Object Instance */

 /* Call the GetDistance method to compute distance between 2 locations

 /* Destroy OLE Automation Object Instance */