我无法在 access 2007 中保存数据。我尝试了以下方法:
- 向我的数据库添加密码;没用
- 将数据库保存为 2003 文件;没用
这是我的代码:
public bool ExecuteUDI(string query)
{
Command = new OleDbCommand();
Command.Connection = Connection;
Command.CommandText = query;
Command.CommandType = System.Data.CommandType.Text;
try
{
// Open connection
Open();
if (Command.ExecuteNonQuery() != -1)
return true;
else
return false;
}
catch (Exception e)
{
mError = "ExecuteUDI - " + e.Message;
return false;
}
finally
{
// Always close connection
Close();
}
}
当我添加断点时,我看到我的查询看起来不错:
INSERT INTO DVD (Titel) VALUES ('Elegy')
我没有收到任何错误,但受影响的行是 0。怎么会?我不明白..