How can I write a connection for the Access database?


I am working with MS Access databse for the first time. I deployed my appilcaton on my server. I have access database on my system (D:\Database).

    <add key="dbcon" value="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=  ?  "/>


When I am trying to connect it is giving error.

How can I modify my connection string?

Regards, NS

I'm assuming that the database have an extension of .mdb, otherwise change it to whatever is needed:

<add key="dbcon" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Database.mdb"/>

So all you needed to do was to add the name of the db file to the connection string.

You can find more samples here.