我目前对一个问题感到困惑。我可以从我的表中插入和删除记录,但我不能更新某些字段。它确实会在 0.5 秒后恢复更改之前暂时更新它,我实际看到了更改。顺便说一句,这是在 Delphi 7 中完成的:
CloseDatabase; // Closes my database first to prevent an error from accessing one that is already open
OpenDatabase; // Dynamically opens the database
ActivateEdits;
if dbeEnglish.Enabled then
begin
qryDictionary.SQL.Text := 'Update [word list] set [english] = "'+dbeEnglish.Text+'" where ([afrikaans] = "'+dbeAfrikaans.Text+'") and ([english] = "'+sEnglishBefore+'")';
qryDictionary.ExecSQL;
end
else
begin
qryDictionary.SQL.Text := 'Update [word list] set [afrikaans] = "'+dbeAfrikaans.Text+'" where ([english] = "'+dbeEnglish.Text+'") and ([afrikaans] = "'+sAfrikaansBefore+'")';
qryDictionary.ExecSQL;
end;
SelectAll; // SQL to select * from [word list] as well as set the column widths
bEngOnce := False; // variable i used to prevent both dbe (data base edits) from being edited
bAfrOnce := False;
我是否在 OI 中更新错误或遗漏了某些内容?它确实更新,只是不会使其永久化。
忘了说:表格单词列表有 3 个字段:一个名为 ID、english 和 afrikaans 的自动编号字段。自动编号是否会导致更新问题?