Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


TurboMagic last won the day on August 8 2021

TurboMagic had the most liked content!

Community Reputation

67 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Found a fix myself! FQuery.UpdateOptions.AutoIncFields := 'PERSON_ID'; This makes FireDAC aware that the not null constraint will be fullfilled by the database itsself.
  2. I just tried this, but it does not work. It throws an EDatabaseError exception that the PERSON_ID must not be null. That field is the primary key and as soon as I delcare it as primary key the DB management tool adds a not null constraint. The exception occurs on the Post line. My code looks like this: FQuery.SQL.Text := 'select Person_ID, LastName, FirstName from persons'; FQuery.Open; FQuery.Append; FQuery.FieldByName('LastName').AsString := 'Doe'; FQuery.FieldByName('FirstName').AsString := 'John'; FQuery.Post; Result := FQuery.FieldByName('Person_ID').AsInteger; The generator value us applied via some ACTIVE BEFORE INSERT trigger by the way...
  3. Thanks! Sounds helpfull and I'll try this later!
  4. The developer of FireDAC somewhere recommended this one: FireDAC.Comp.Client.TFDCustomConnection.GetLastAutoGenValue But that also retrieves the last value of the generator and thus should better be avoided for most RDMS, at least in multi user scenarios. Somewhere else adding this to the insert statement is recommended: RETURNING ID INTO :ID This would return the value in a field named ID. But: FireDAC doesn't seem to support this. If I add this to the insert the Prepare call throws an error: Dynamic SQL error. Error code -104, Token unknown, Line 1 column 138. Where column 138 (at least when I copy out the SQL text in the debugger) is one of the parameters before...
  5. In my case I have used this one: FQuery.SQL.Text := 'insert into MYTABLE ' + '(LASTNAME, FIRSTNAME) ' + 'VALUES (:NEW_LASTNAME, :NEW_FIRSTNAME);'; FQuery.UpdateOptions.AutoIncFields := 'PERSON_ID'; FQuery.CachedUpdates := false; FQuery.Prepare; Later on I fill in values like this, which works and created unique IDs: FQuery.ParamByName('NEW_LASTNAME').AsString := 'Doe'; FQuery.ParamByName('NEW_FIRSTNAME').AsString := 'John'; FQuery.ExecSQL; But how to retrieve the generated new PERSON_ID?
  6. This is exactly the help topic I don't fully understand! I'm having the same issue right now, but with a Firebird database. The help topic doesn't show me (at least not in a form I can understand) hot to access the generated value after calling ExecSQL. And the sample linked I don't understand either.
  7. 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.
  8. TurboMagic

    TaskMessageDlg('.... behind form?

    Ok, I invested the time to try to replicate this in a reduced demo, but there the problem doesn't happen!
  9. TurboMagic

    TaskMessageDlg('.... behind form?

    Your idea is of course how one might find it, if it shows in a reduced demo. My first question would be: what's different between those two forms that one shows this problem and the other works as expected. So which properties or behavior can influence that? Both forms have set: - BorderIcons := [biSystemMenu,biMinimize,biMaximize] - BorderStyle := bsSingle - DefaultMonitor := dmActiveForm - FormStyle := fsNormal - PopupMode := pmNone also pmAuto doesn't change this - PopupParent := nil, but also setting it to TCustomForm(AOwner) in the constructor didn't change anything - Position := poOwnerFormCenter - WindowState := wsNormal The form itsself only has an OnShowEvent, where one control gets set the focus. Any other properties known which might play a role here?
  10. TurboMagic

    TaskMessageDlg('.... behind form?

    I might try later on, but it might prove difficult. I already tried to do a minimal demo for something else I saw in that project and reported as QP 38385, but the minimal demo failed to show the effect. In the German DP somebody said something that all new forms seem to have some popupparent issue as if always the main form would be used as popup parent... I haven't done any investigation of that theory yet, as I just read it. Could that be related?
  11. TurboMagic

    TaskMessageDlg('.... behind form?

    Strange! I found this post because I have exactly the same issue, but the solution above doesn't fix my issue 😞 Given: - D11.1 - a datamodule containing a TTaskDialog - a main form - two other forms, each having a button for showing that TTaskDialog - both forms have the same popup mode, border style etc. - both are created at runtime and shown via ShowModal and when created both get the main form set as owner - in one form the TaskDialog shows in the foreground, in the other it stays in the background - calling execute with self.handle as param doesn't help Now I copied the Taskdialog from the datamodule directly on the form where it doesn't work and called that directly. Result: still doesn't work 😞 Anybody any clue?
  12. Now I am. Thanks! But for which version is this? The one our new project already has as starting point is compatible with 10.3 and I guess mostly compatible with that release so I guess it's newer than the one you linked. But you can compare both versions I guess...?
  13. This would be another approach. At least for the start we should attract many developers to get it started. I know that you're after, but if we make entry barrier as low as possible at the start we might attract more contributors. We can still switch afterwards if we find that some don't do the right things. But: we need people working on it. Otherwise it's useless... 😉
  14. Hello, this is to let you know that there was a open source collaboration project started to create a formal specification of the Delphi language in Backus-Naur format (https://en.wikipedia.org/wiki/Backus–Naur_form). It is hosted on GitHub here: https://github.com/MHumm/DelphiGrammar David Hoyle contributed his Delphi 10.3 version as a starting point. If you want to participate in this endeavor, which might help developers of language tools, just drop me a message with your GitHub account name and I'll give you commit permission. Either via this forum or as an issue on that GitHub project. Currently I picked Apache 2.0 as license, but if necessary we can discuss to use something else. Cheers TurboMagic
  15. TurboMagic

    DEC V6.4.1 released

    I just noticed, that I hadn't completed the release publication back then due to too much going on short before Christmas. This has been "fixed" now. The direct link to the release is here: https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.4.1 And work on a V6.5 already started. Contributors are welcome. Cheers TurboMagic