1
保存數據無法保存在Access 2007中的數據我試過如下:C#不能在Access 2007中
- 添加一個密碼,我的數據庫;沒有工作
- 將db保存爲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.怎麼回事?我不明白..
有人可能會重申這個問題嗎?它不是「訪問2007年」,它被標記爲訪問和2007年......感覺不對。 – Johan 2009-02-10 19:37:50