Bert, Ed Dressel, i've found the reason.
That is:
When i use cxgrid's method "AppendRecord" , it doesn't operate the DB and insert record. But "Append" does. As a matter of fact , i insert record twice.
Do you know how to delete a record which i select in cxgrid? update rapidly?
my code is ( it doesn't update rapidly ) :
//************************** delete record ***********************************//
procedure TForm4.dellog(id: Integer);
begin
If Application.MessageBox('Delete?','',MB_OKCANCEL+MB_ICONQUESTION+MB_DEFBUTTON1+MB_APPLMODAL)=ID_OK Then
if id > 0 then
begin
with adoquery2 do
begin
close;
sql.Clear;
ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;Persist Security Info=False';
sql.Add('delete * from log where id =' + inttostr(id));
ExecSQL;
end;
end;
end;
//**************************** End **********************************//