Can't connect to MS Access database

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
 
O

One Handed Man

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top