1)ACCESS 2007 如下:
string connString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
"Data Source=C:\database\Access\myDb.accdb;";
2)ACCESS 2003 如下:
string connString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|DatamyDb.mdb;Persist Security Info=True" providerName="System.Data.OleDb";";
3)Access 2000 如下:
string connString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:mydatabase.mdb;User
Id=admin;Password=;";
4)连接本地文件:
string str = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:db.mdb;";
5)连接网络盘:
string str = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\dg001groups7PLdbFYI.mdb;";