
Variable uses an Automation type not supported in Visual Basic
I'm getting this error in a MTS object developed in
Visual Basic 6.0. This
object has the following code:
Public Function GetCorporateAdvisories() As ADODB.Recordset
Dim objSQL As deSQL
Dim strErrorMessage As String
On Error GoTo ErrorHandler
Set objSQL = New deSQL
objSQL.conCorporate.Open
objSQL.dbo_spGetAdvisories
If Not objSQL.rsdbo_spGetAdvisories Is Nothing Then
Set GetCorporateAdvisories = objSQL.rsdbo_spGetAdvisories.Clone
Set GetCorporateAdvisories.ActiveConnection = Nothing
End If
Done:
If Not objSQL Is Nothing Then If Not objSQL.conCorporate.State <>
adStateClosed Then objSQL.conCorporate.Close
Set objSQL = Nothing
Exit Function
ErrorHandler:
If Not objSQL Is Nothing Then If Not objSQL.conCorporate.State <>
adStateClosed Then objSQL.conCorporate.Close
Set objSQL = Nothing
Exit Function
End Function
It all works great in VB Environment. I compile the object, install it on MTS,
create the export, execute the package client, set the reference in my client and
I get the error when I execute the line:
Set GetCorporateAdvisoriesRs = objSel.GetCorporateAdvisories().Clone
Which is after I create an instance of the object.
Any help would be appreciated.
Pat