|
self.ADOQuery1.Active: = false;
self.ADOQuery1.SQL.Clear;
sqlstr: = 'select * from projectdonghua where pid =' + inttostr (pid) + 'order by did';
self.ADOQuery1.SQL.Add (sqlstr);
try
self.ADOQuery1.Open;
except
self.ADOQuery1.ExecSQL;
end;
self.ADOQuery1.First;
for i: = 1 to self.ADOQuery1.RecordCount do
begin
self.ADOQuery1.Edit;
self.ADOQuery1.FieldByName ('DID'). AsInteger: = i;
self.ADOQuery1.Post;
showmessage (self.ADOQuery1.fieldbyname ('did'). AsString);
self.ADOQuery1.next;
end;
At that time, the DID was updated, but the records in the actual database were not updated. I used ADOQuery1 to disconnect and check it again. It is the same as the original. What is wrong? Thank you. |
|