Console FireDAC Example wanted

Console FireDAC Example wanted

Doing FireDAC againt MSSQL or PostgreSQL visually is easy, but when I try to do it in code only – I get weird errors and there must be something essential that I miss.

Does anyone have a code only example of how to set up a FireDAC connection?


20 thoughts on “Console FireDAC Example wanted

  1. I set these params on the BeforeOpen, see if it helps :

         myDatabase.Params.Values[‘Password’] := ‘***’;

         myDatabase.Params.Values[‘User_Name’] := ‘postgres’;

         myDatabase.Params.Values[‘Database’] := ‘mydatabasename’;

         myDatabase.Params.Values[‘Port’] := ‘5432’;

         myDatabase.Params.Values[‘Server’] := ‘’;

    Besides, I have no problems with FD and PG.

  2. function TFDAdaptedDataSet.GetOptionsIntf: IFDStanOptions;


      Result := Command.OptionsIntf;

    AV because Command is nil







  3. Magno Lima 







  4. For example MSSQL:

    1. Create a TFDPhysMSSQLDriverLink instance

    2. Create a TFDConnection and set the params

    3. Create a TFDQuery and set the connection

    The driver link has to be created only once for the application, while the connection has to be separate for each connection(obviously) and for each thread. Make sure to say “uses uFDGUIxConsoleWait” somewhere. 

  5. Uwe Raabe 

    1. Check – Single instance

    2. Check – One instance per target server

    3. Check

    uFDGUIxConsoleWait is named FireDAC.ConsoleUI.Wait in XE6 and XE7.  Does it matter if it is included in a GUI app as well?

    Still same problem.

  6. Please set a break point on

    unit FireDAC.Comp.Client;

    function TFDAdaptedDataSet.GetCommand: TFDCustomCommand;   //BP here


      if Adapter nil then

        Result := Adapter.SelectCommand   // you lack of SelectCommand?


        Result := nil;


    if AV cause by Command is nil.

  7. Sam Shaw Adapter is assigned.

    The actual code is a rewrite of ADO code, and I am starting to suspect that I am doing some silly ADOism where I should be doing things differently and the FireDAC way.

  8. Lars Fosdal yes it works, but as it is a string list will add new line and by default using the last one… Maybe someone told but dont forget using TWaitCursor. When creating FD connection for postgres in runtime I dont mess with any other parameter but that I told first. I am using XE5.