0
votes

I am using the following connection string to connect with my access database from vb.net application, but not get connected.

Driver={Microsoft Access Driver (*.mdb)}; Dbq=D:\Projects\tempdb.mdb

It shows me following error

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

My code is below:

 Dim odbcConn As OdbcConnection = New OdbcConnection(m_connectionString)

 '' Build thr odbc Dataadapter
 Dim odbcAdpt As OdbcDataAdapter = New OdbcDataAdapter(QueryToExecute, odbcConn)
 odbcAdpt.SelectCommand.CommandType = CommandType.Text
1
try m_connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Projects\tempdb.mdb; Persist Security Info=False;" - nazark

1 Answers

1
votes

I had connection problems. My project was not connecting to database because there were no default driver. I have solved this problem. If you are using 64-bit OS you must use 64-bit MS office. similarly if you are using 32-bit OS you must need 32-bit MS office. Be sure that you have all application of same number of bits. Hopefully it will solve your problem.