保存数据出错,是什么原因?
2312 2003-12-08 09:53:13 with datamodule6.ADOQuery3 do
begin
if active then
close;
SQL.Clear;
SQL.add('select * from 用户');
ExecSQL;
open;
if RecordCount>0 then
begin
first;
if Locate('帐号,用户级别',vararrayof([strUser,未审核']),[locaseinsensitive]) then
begin
if application.messagebox(确定通过?', '提示',mb_YesNo+MB_APPLMODAL+MB_ICONQUESTION+MB_DEFBUTTON2)=idyes then
begin
edit;
fieldByName('用户级别').AsString:='user';
post;
end
else
exit;
end;
end;
DataModule6.ADOQuery3.Refresh;
end;
此条记录数据库里面已经存在,我只是修改,但出错,什么原因?
错误提示:由于在主关键字,索引值,主键中存在重复的记录,不能保存!!