ado ole方式访问access的两种方式
时间:2021-07-01 10:21:17
帮助过:41人阅读
OleDbConnection();
OleDbDataAdapter adapter =
null;
//ConnectiongString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
// + Path + ";Extended Properties=‘Excel 8.0;HDR=no;IMEX=0‘";
ConnectiongString =
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
+ Path +
";Persist Security Info=False";
Connection.ConnectionString =
ConnectiongString;
Connection.Open();
//adapter = new OleDbDataAdapter("SELECT * FROM [MAP仓库库存$] ",
// Connection);
adapter =
new OleDbDataAdapter(
"SELECT * FROM SunData ",
Connection);
dtTable =
new DataTable();
DataSet DataSet1 =
new DataSet();
adapter.Fill(DataSet1);
dtTable = DataSet1.Tables[
0];
ado ole方式访问access的两种方式
标签:dataset hdr ase open 4.0 div bsp pen info