onemorecoke
asked on
Provider not found with ado.net
I am using this code to connect to an access database in vb2008 and using the adodb reference but it says:
"Provider cannot be found. It may not be properly installed."
I use the Jet provider in other programs on the computer so I know it is there.
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
On Error GoTo ErrTrap
cn.Open("Provider=Microsof t.Jet.OLED B.4.0;Data Source=e:\builtin.mdb;User Id=admin;Password=;")
rs.Open("select * from TestCase", cn)
While Not rs.EOF
MsgBox(rs("EmailAddress"). Value)
rs.MoveNext()
End While
rs.Close()
cn.Close()
"Provider cannot be found. It may not be properly installed."
I use the Jet provider in other programs on the computer so I know it is there.
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
On Error GoTo ErrTrap
cn.Open("Provider=Microsof
rs.Open("select * from TestCase", cn)
While Not rs.EOF
MsgBox(rs("EmailAddress").
rs.MoveNext()
End While
rs.Close()
cn.Close()
Did you look in your refernces in that project to see if you really are seeing ADO?
ASKER
My reference should be ADODB.DLL right? Seems like everything is good. I use the same connection string in a VB6 program with no problems.
ASKER
Could it be a 32bit/64bit issue? Started up a new project with just defaults so I am assuming it is 32bit.
You should be using something like this
Microsoft ActiveX Data Objects 2.8 Library
Are you using VS 2005 or 2008?
Microsoft ActiveX Data Objects 2.8 Library
Are you using VS 2005 or 2008?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No one answered it correctly but I kept working on it