.net c# code to connect to MS Access DB in SharePoint

Hi Frndz,
I need your help.

Currently i have written a piece of code which connects to MS Access DB to fetch the data, it works fine in a standalone system.
I need to place the c# code and MS Access DB in Sharepoint Server and need to fetch the data.
I tried various Connection Strings methods to establish the connection with MS Access DB, but proved to be fuitle.
Its inline coding in C#.
Can you juz help me out of how the connection to a MS Access DB placed in Sharepoint Server.

Maybe a little help, a c# sample connect part:

<!–MS ACCESS sample connection string–>
<add name=“YourConnectionString” connectionString=“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|YourDataPath/Dir|accessdata.mdb;Jet OLEDB:Database Password=DB_PASSWORD;” providerName=“System.Data.OleDb”/>

Edit: there is a bug for script’s: [: D] (display a grin), below code are updated, remove the extra space.

<!–MS ACCESS sample connection string–>
<add name=“YourConnectionString” connectionString=“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|YourDataPath/Dir|accessdata.mdb;Jet OLEDB: Database Password=DB_PASSWORD;” providerName=“System.Data.OleDb”/>

For reference only.
Ked :slight_smile:

What version of Access are you using? What version of SharePoint? Are you trying to syncronize an Access database with a SharePoint list? More information about the problem you are trying to solve will help.

Hi Dear
Before going for connection you should first of all create the DSN name and it is must. For creating the DSN Name go to control panel-Administrative tool- ODBC connectivity-Add- and finally put the DSN Name. You can choose User DSN or System DSN any of them. If u are using on same machine then choose User DSN if u are using different machine then choose System DSN.
Now put your DSN Name in place of Connection string :slight_smile: