string strSql = "delete from 工厂 where trim(NAME) = '" + textBox1.Text.Trim() +"'";
string strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\DBase;Extended Properties=dBASE IV;User ID=Admin;Password=";
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(strCon);
conn.Open();
System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand();
cmd.Connection = conn;
cmd.CommandText = strSql;
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
conn.Close();我用这种方试(OleDB)不能真正删除,只作了删除标识。用ODBC连接方式也不行。是不是要在那里设置独占什么的吗?
谢谢指教!