连接Access用“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MTLM.mdb;Persist Security Info=False”字符串试下,一般连接excel用Provider=Microsoft.ACE.OLEDB.12.0;而连接Access用Provider=Microsoft.Jet.OLEDB.4.0;
string _strConn = @"provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "Tabel1.accdb"; //access 2010
string _strConn = @"provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + "Tabel1.accdb"; //access 2003