
Variable uses Automation Type not supported in Visual Basic
Is the error message I am recieving while trying to get the value of a
field in an Oracle 8.17 database with VB6. Here is the connection
string:
"Provider = MSDAORA;Password=fake;User ID=Fake;Data Source = Fake"
The field is an oracle 'number', (the data type, not an object) and I
am trying to apply it to a variable declared as a long (but I get the
same error message with an integer or double). The code IS able to
apply the varchar2 strings to the vb6 strings.
I refuse to believe that Microsoft would issue an Oracle Driver that
does not recognize an Oracle number, so I would like to know what I am
doing wrong!
++++++++++++++++++++++++++++++
Dim StrOracleConn As String
Dim OracleConn As ADODB.Connection
Dim Lister1 As String
Dim rsLister1 As ADODB.Recordset
Dim empid As Long
Dim first As String
Dim last As String
Dim userid As String
Dim supid As Long
empid = 0
StrOracleConn = "Provider=MSDAORA;Password=Var;User ID=Var;Data
Source=Var"
Set OracleConn = New ADODB.Connection
OracleConn.Open StrOracleConn
Lister1 = "select first, last, empid, supid from emp"
Set rsLister1 = New ADODB.Recordset
rsLister1.Open Lister1, OracleConn
While Not rsLister1.EOF
empid = rsLister1("empid")
last = rsLister1("Last")
first = rsLister1("First")
supid = rsLister1("supid")
Debug.Print last
rsLister1.MoveNext
Wend
End Sub
+++++++++++++++++++++++++
Please let me know if you see what I'm doing wrong, or even if you
DON'T see what I'm doing wrong (even negative feedback helps!)
Thanks,
Sara