C
cr113
I just started using Access VBA 2003 and I came across 2 very odd
things:
Why is the syntax different from Excel? In my Excel macros I use the
Microsoft ActiveX Data Objects 2.8 Library. Here is a code sample in
Excel:
Dim cnn As New Connection
Dim rst As New Recordset
Dim strSQL As String
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb"
Set rst = Nothing
strSQL = "SELECT * FROM Table1"
rst.Open strSQL, cnn
When I tried this in Access it didn't like the "New" qualifier and
Open was not a function of the recordset class. Why is this? It's the
exact same reference.
Also after I was trying to get the code in Access to work I noticed
that all of my Excel references were changed from Microsoft ActiveX
Data Objects 2.8 Library to Microsoft ActiveX Data Objects 2.1
Library.
Does anyone know what is going on? Help!!!!
things:
Why is the syntax different from Excel? In my Excel macros I use the
Microsoft ActiveX Data Objects 2.8 Library. Here is a code sample in
Excel:
Dim cnn As New Connection
Dim rst As New Recordset
Dim strSQL As String
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb"
Set rst = Nothing
strSQL = "SELECT * FROM Table1"
rst.Open strSQL, cnn
When I tried this in Access it didn't like the "New" qualifier and
Open was not a function of the recordset class. Why is this? It's the
exact same reference.
Also after I was trying to get the code in Access to work I noticed
that all of my Excel references were changed from Microsoft ActiveX
Data Objects 2.8 Library to Microsoft ActiveX Data Objects 2.1
Library.
Does anyone know what is going on? Help!!!!