TDataSet.State lazarus / 16-Databases ---------------------------------------------------------------------- gambothell · 2007-09-16 23:42 Using the TDbf component, I tried testing the database state in a case statement. I tried using the Delphi approach of checking against dsInsert, dsBrowse, dsEdit, dsInactive, but I get an error of identifier not found. What are the TDataSet.States for the TDbf component? Thanks ---------------------------------------------------------------------- piper62 · 2007-09-27 22:54 hi, here's some code what I use to set buttons on a form active/inactive regarding the dataset state. probably it's helpful. regards, tibor -------------------------------- procedure Tfo_docimage.Datasource1StateChange(Sender: TObject); begin    if DataSource1.Dataset <> nil then    begin       if DataSource1.State in [dsEdit, dsInsert] then       begin          b_load.Enabled := false;          b_output.Enabled := false;          b_save.Enabled := true;          b_delete.Enabled := false;          b_edit.Enabled := false;          b_cancel.Enabled := true;          b_exit.Enabled := true;       end       else       begin          b_load.Enabled := true;          b_output.Enabled := true;          b_save.Enabled := false;          b_delete.Enabled := true;          b_edit.Enabled := true;          b_cancel.Enabled := false;          b_exit.Enabled := true;       end;    end; end; ------------------------------------ ---------------------------------------------------------------------- ssamayoa · 2007-09-28 01:41 Quote from: "gambothell"Using the TDbf component, I tried testing the database state in a case statement. I tried using the Delphi approach of checking against dsInsert, dsBrowse, dsEdit, dsInactive, but I get an error of identifier not found. Which one? I guess you forget to include db unit in your uses clause. Regards. ---------------------------------------------------------------------- gambothell · 2007-09-28 17:33 You were right. Thanks for the help.