Link to home
Start Free TrialLog in
Avatar of OceanStars
OceanStars

asked on

Excel 2003 Connection error message "User-defined type not defined"

From Excel 2003 need to connect to Access database.  
This line of VB code in the Visual Basic Editor    
Dim cnn As ADODB.Connection  
always gives error message : "User-defined type not defined"



Dim cnn As ADODB.Connection
Set cnn = New adodb.Connection
   With cnn
      .ConnectionTimeout = 500
      .Provider = "Microsoft.Jet.OLEDB.4.0"
      .ConnectionString = "Data Source=" & strPathToDB & ";"
      .Open
      .CommandTimeout = 500
   End With

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of spattewar
spattewar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OceanStars
OceanStars

ASKER

Thank you.  I just found the answer myself.  You are fast!