ado ole方式访问access的两种方式
Posted ChineseMoonGod
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ado ole方式访问access的两种方式相关的知识,希望对你有一定的参考价值。
OleDbConnection Connection = new 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的两种方式的主要内容,如果未能解决你的问题,请参考以下文章