Update and display of the table in Delphi component TIBQuery and TIBTable



  • In Delphi, I added the table through TIBTable, and in TIBQuery is sql SELECT * FROM autors♪ This TIBQuery is attached to the TDBGrid display table. Thus, a new record (injected through TIBTable) is entering the OBD, but not immediately displayed in TDBGrid. Here's the code I've got:

    //FM_Data.IBTransaction1.StartTransaction;
    FM_Data.IBT_Autors.Insert;
    FM_Data.IBT_Autors.FieldByName('NAME').AsString := FM_AddAutor.E_AddedAutorName.Text;
    FM_Data.IBT_Autors.Post;
    //FM_Data.IBTransaction1.Commit;
    FM_Data.DS_Autors.Enabled := false;
    DBGRid1.Enabled := false;
    

    FM_Data.IBQ_Autors.Close;
    FM_Data.IBQ_Autors.Active := false;
    //FM_Data.IBQ_Autors.ExecSQL;
    FM_Data.IBQ_Autors.Active := true;
    FM_Data.IBQ_Autors.Open;
    FM_Data.DS_Autors.Enabled := true;
    DBGRid1.Enabled := true;
    ShowMessage('YES');

    Here IBQ_Autors - TIBQuery, IBT_Autors - TIBTable, DS_Autors - TDataSource, and then everything is clear. Turned up, of course, great. Can you tell me what to do?



  • The question was very simple. It's just that all components related to the Dana database are on the same form as the table on buttons and the treatment code for what is related to the OBD. In short, if TIBDataBase is in a different form, nothing good will happen.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2