Please enable Javascript to correctly display the contents on Dot Net Tricks!

Microsoft Access Connection Strings

  Author : Shailendra Chauhan
Updated On : 17 Feb 2012
Total Views : 9,121   
 

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

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

Using OLEDB

 // OleDb with MS Jet -- Standard Security
using System.Data.OleDb;
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\mypath\myDb.mdb; User id=admin;Password=password";
conn.Open();
 // OleDb with MS Jet -- Workgroup (System Database)
using System.Data.OleDb;
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\mypath\myDb.mdb; System Database=c:\mypath\myDb.mdw";
conn.Open(); 
YOU MIGHT LIKE
Free Interview Books
 
COMMENTS (0)
14 DEC
ASP.NET MVC with AngularJS Development (online)

MON-FRI 07:30 AM- 09:00 AM IST

Know More
11 DEC
ASP.NET MVC with AngularJS Development (offline)

Sat-Sun 09:30 AM-11:00 AM IST

Know More
5 DEC
AngularJS Development (online)

Mon - Fri     6:30 AM-7:30 AM IST

3 DEC
AngularJS Development (offline)

SAT,SUN     11:00 AM-12:30 PM IST

3 DEC
MEAN Stack Development (offline)

Sat, Sun     (11:00 AM-12:30 PM IST)

26 NOV
ASP.NET MVC with AngularJS Development (offline)

(SAT,SUN)     03:30 PM-05:00 PM IST

24 NOV
ASP.NET MVC with AngularJS Development (online)

MON-FRI     09:30 PM-11:00 PM IST

12 NOV
ASP.NET MVC with AngularJS Development (offline)

SAT,SUN     08:00 AM-09:30 AM

3 NOV
ASP.NET MVC with AngularJS Development (online)

MON-FRI     07:30 AM-09:00 AM IST

25 OCT
.NET Development (offline)

Mon-Fri     9:00 AM-11:00 AM IST

BROWSE BY CATEGORY
 
RECENT ARTICLES
SUBSCRIBE TO LATEST NEWS
 
LIKE US ON FACEBOOK
 

Professional Speaks

+