Jump to content

Hans J. Ellingsgaard

Members
  • Content Count

    84
  • Joined

  • Last visited

Posts posted by Hans J. Ellingsgaard


  1. On 6/5/2022 at 3:59 PM, TurboMagic said:

    Some Firebird documentation about generators I just read recommends to NOT directly query a generator like that for master/detail tables, as in multi user scenarious you cannot be sure whether somebody already further incremented the generrator etc.

    I can not see why this should be a problem, you got your ID and stick to it until your record is finally posted to the database. You use it as a primary key on your mastertable and a foreign key on the detail table. The generator is running outside the transactions, and you are guaranteed to get a unique value each time you request for an ID.


  2. On 5/13/2022 at 10:26 AM, Fons N said:

    In the OnConstrainedResize event of the Form include the following:


    MaxHeight:= Screen.WorkAreaHeight;
    MaxWidth:= Screen.WorkAreaWidth;

    You could use the Constraints property of the form instead of using the Event.

     

    Self.Constraints.MaxHeight := Screen.WorkAreaHeight;
    Self.Constraints.MaxWidth := Screen.WorkAreaWidth;
     

     

    • Like 1

  3. If you place the dll files manually into the windows system folders, you'll need to run regsvr32 to register them in Windows. If you use the installer it will register them for you. If you place them in your programs root folder, there is no need for registration.


  4. One way to get around that datetime field, is to create a View on the datbase, where you cast your datetime field to a date field, and then connect the table component to the view instead of the query.

     

    Is there a specific reason why you want to use a table compnent instead of a query?


  5. If you use the StartTransaction command, you have to finish it off with CommitTransacton or a  Rollback. If you're not using a StartTransaction, the FDConnection will start it for you and make a commit when your datasets are closed.


  6. Your problem might have something to do with nested transactions. If your db or your odbc driver don't support nested transactons, make shure there is no ongoing transaction on the same connectionm, before you call StartTransaction.

     

    Something like this:

        if FDConnection1.InTransaction then
           FDConnection1.Commit;
     

        FDConnection1.StartTransaction;

×