110,536
社区成员
发帖
与我相关
我的任务
分享
OleDbConnection connection;
string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + newPath + ";Persist Security Info=False";
connection=new OleDbConnection(connStr);
string sql = "Select * into newTable From [;database=" + Application.StartupPath + @"\oldDB.accdb;].oldTable";
using (OleDbCommand command = new OleDbCommand(sql, connection))
{
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}