DelphiFAQ Home Search:
General :: Programming :: Delphi :: Database
Database development with Delphi. Includes issues with BDE, ADO and InterBase.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Keep a dataset in dsInsert/dsEdit mode after validation fails

If you want to keep a dataset in dsInsert/dsEdit mode after a validation fails, but do not want to loose your input, use Abort in the BeforePost() event.

(If you would use Dataset.Cancel, you'd loose the input and return to browse mode.)

procedure TForm1.Table1BeforePost(DataSet: TDataSet); 
 begin 
   if Table1ID.Value <= 0 then 
   begin 
     // the data is invalid!!
     Showmessage('Error! Invalid value!'); 
     Abort
   end
   else 
     Table1.Post; 
 end; 

Generated 12:01:47 on Feb 24, 2018