Mega Code Archive

 
Categories / Delphi / ADO Database
 

How to stop the DBGrid control from auto appending a new entry

Title: How to stop the DBGrid control from auto-appending a new entry procedure TForm1.Tbable1BeforeInsert(DataSet: TDataSet); begin Abort; { end; {A: It traps the down key and checks for end-of-file.} procedure TForm8.DBGrid1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Key = VK_DOWN) then begin TTable1.DisableControls; TTable1Next; if TTable1.EOF then Key := 0 else TTable1.Prior; TTable1.EnableControls; end; end;