ADO problems in Access 97

creeping

Registered User.
Local time
Today, 23:14
Joined
Feb 9, 2003
Messages
20
Hi I'm just starting out using ADO in access but I can't get the code to compile in Access 97. The first part of the code is:


Code:
Option Compare Database
Option Explicit

Private Sub Command0_Click()

Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

Dim curdb As Database
Set curdb = CurrentDb
Set CurConn = New ADODB.Connection

With CurConn
  .Provider = "Microsoft.Jet.OLEDB.4.0"
  .ConnectionString = "data source= " & curdb.Name
  .Open
End With

What happens when I try to compile the module is I get the following message: "User-defined type not defined" and it highlights the line with "Dim cnn As New ADODB.Connection" in it
Does that mean I have not got ADO installed correctly

Can anyone help me out?
 
The problem is you are trying to use Microsoft Jet 4.0
Change it to 3.5 and it should work fine.

Jet 4.0 is used in Access 2K
 

Users who are viewing this thread

Back
Top Bottom