è¡¥å
ä½ çå½æ°ä½ï¼
string connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\A.mdb;";
string comString1 = @"select * into [n] from [D:\B.mdb].[n]";
åºæ¬å°±æ¯è¿æ ·ï¼é»è®¤æå¡å¨åæ¶æä¸è´ï¼ï¼æå¥½ä½ è¿åä¸ä¸ªå¤æAæ°æ®åºåæ¬æ没æè¿ä¸ªè¡¨nï¼é²æ¢éå¤æå
¥ã
ä¸é¢æ¯å¤æ表ææ åå¨çæ¹æ³
public static bool tableExist(string tableName)
{
try
{
string connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Data.mdb;";
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
DataTable dt = conn.GetSchema("Tables");
conn.Close();
DataRow[] drs = dt.Select(string.Format("TABLE_TYPE='TABLE' and TABLE_NAME='{0}'", tableName));
if (drs.Length > 0)
{
return true;
}
else
{
return false;
}
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
return false;
}
}
温馨提示:内容为网友见解,仅供参考