Can't connect to MS Access database

  • Thread starter Thread starter Tor Inge Rislaa
  • Start date Start date
T

Tor Inge Rislaa

Can't connect to MS Access database

Hi I am trying to connect to an MS Access database but it keeps failing.
When I try connecting to a MS SQL database it works just fine.

My code is as follow:

Dim cnn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data Source=C:\data\mydb.mdb")

cnn.Open()

(User name on the DB is 'Admin' with blank password)



The error description appearing is:

An unhandled exception of type 'System.NotSupportedException' occurred in
mscorlib.dll

Additional information: The given path's format is not supported.



Any Ideas

T.I Rislaa
 
Ttry putting the OLEDB connection object on your form and then getting the
connection string from that to use in your code. Once you have it working
you can delete the connector.

Your connection string is clearly in error anyway with two data sources.
 
Back
Top