J
jbas
Unregistered / Unconfirmed
GUEST, unregistred user!
请高手看看这哪里错了!
procedure Talter.qd1Click(Sender: TObject);
begin
diarydata.tx.Close;
diarydata.tx.SQL.Clear;
diarydata.tx.SQL.Add('select * from tx where cs=1');
try
diarydata.tx.open;
except
diarydata.tx.ExecSQL;
diarydata.tx.Active:=true;
end;
if diarydata.tx.FindLast then
begin
if (messagedlg('是否重新设定提醒事件?',mtwarning,[mbyes,mbno],0)=mryes) then
begin
diarydata.tx.Close;
diarydata.tx.SQL.clear;
diarydata.tx.sql.Add('insert into tx(cs,nr,sj) values (1,:nnr,:nsj)');
diarydata.tx.parambyname('nnr').asstring:=trim(alert1.text);
diarydata.tx.parambyname('nsj').asstring:=trim(tabsheet1.caption);
try
diarydata.tx.open;
except
diarydata.tx.ExecSQL;
diarydata.tx.active:=true;
end;
end;
end
else
showmessage('no found');
end;
数据教验!!!总出现"...key violation" 错误!!!
procedure Talter.qd1Click(Sender: TObject);
begin
diarydata.tx.Close;
diarydata.tx.SQL.Clear;
diarydata.tx.SQL.Add('select * from tx where cs=1');
try
diarydata.tx.open;
except
diarydata.tx.ExecSQL;
diarydata.tx.Active:=true;
end;
if diarydata.tx.FindLast then
begin
if (messagedlg('是否重新设定提醒事件?',mtwarning,[mbyes,mbno],0)=mryes) then
begin
diarydata.tx.Close;
diarydata.tx.SQL.clear;
diarydata.tx.sql.Add('insert into tx(cs,nr,sj) values (1,:nnr,:nsj)');
diarydata.tx.parambyname('nnr').asstring:=trim(alert1.text);
diarydata.tx.parambyname('nsj').asstring:=trim(tabsheet1.caption);
try
diarydata.tx.open;
except
diarydata.tx.ExecSQL;
diarydata.tx.active:=true;
end;
end;
end
else
showmessage('no found');
end;
数据教验!!!总出现"...key violation" 错误!!!