Access/VB ADO run time error 91.
Posted on 2002-07-11
I just started a project in Access 2000 and I'm having trouble with ADO recordsets.
I added the following code to a form's load sub...
Dim db as New ADODB.Connection
Dim rs as New ADODB.Recordset
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\db1.mdb;" & _
"Persist Security Info=False"
When I try and run the form it bombs out on the db.Open line with "run-time error 91 -- Object variable or with block variable not set"
I tried various variations all achieve the same result.
Do I need to set anything up in VB or Access to use ADO?
Can anyone help me out?