Microsoft Access Connection Strings

In Ado.net we have multiple options to connect to Microsoft Access database. For this purpose we have different connection string to connect to the Microsoft Access database. Basically it is not easy to remember different database connection strings in Ado.Net. So I am sharing some connection strings to connect to the Microsoft Access database using different drivers.

Using ODBC

  1. // ODBC -- Standard Security
  2. using System.Data.Odbc;
  3. OdbcConnection conn = new OdbcConnection();
  4. conn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:\myPath\myDb.mdb; Uid=Admin; Pwd=;password";
  5. conn.Open();
  6. // ODBC -- Workgroup (System Database)
  7. using System.Data.Odbc;
  8. OdbcConnection conn = new OdbcConnection();
  9. conn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:\myPath\myDb.mdb; SystemDb=c:\myPath\myDb.mdw;";
  10. conn.Open();


  1. // OleDb with MS Jet -- Standard Security
  2. using System.Data.OleDb;
  3. OleDbConnection conn = new OleDbConnection();
  4. conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\mypath\myDb.mdb; User id=admin;Password=password";
  5. conn.Open();
  6. // OleDb with MS Jet -- Workgroup (System Database)
  7. using System.Data.OleDb;
  8. OleDbConnection conn = new OleDbConnection();
  9. conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\mypath\myDb.mdb; System Database=c:\mypath\myDb.mdw";
  10. conn.Open();