Firebird 2 - TIBCLoader - Boolean

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Jean-Christophe
Posts: 5
Joined: Thu 10 Oct 2013 09:42

Firebird 2 - TIBCLoader - Boolean

Post by Jean-Christophe » Wed 27 Jan 2016 14:09

Hello,

I have a dataset with several Boolean Fields i need to transpose into a Firebird 2.3 to 2.5.5 database.

Declaring fields and executing TIBCLoader is really easy but how can I handle Boolean fields ?

Many thanks in advance for any hint or example you can provide me with.

Jean-Christophe
Posts: 5
Joined: Thu 10 Oct 2013 09:42

Re: Firebird 2 - TIBCLoader - Boolean

Post by Jean-Christophe » Tue 02 Feb 2016 07:53

I was using "LoadFromDataset", but using "Load" with "OnGetColumnData" did the job, while locating myself the data like this :

Code: Select all

if Row<>myIBCQuery.RecNo then myIBCQuery.RecNo := Row;
Is locating the rec number the good way, or does it take too much time for the procedure to be efficient ?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Firebird 2 - TIBCLoader - Boolean

Post by ViktorV » Fri 12 Feb 2016 13:28

Please clarify the point of your question concerning work with boolean fields.
To load data using the Load method and the OnGetColumnData event handler, you can use the following recommendations:
1. Execute myIBCQuery.First before calling the TIBCLoader.Load method.
2. In the OnGetColumnData event handler, execute the following code:

Code: Select all

procedure TForm.IBCLoaderGetColumnData(Sender: TObject;
  Column: TDAColumn; Row: Integer; var Value: Variant; var IsEOF: Boolean);
begin
  IsEOF := Row > myIBCQuery.RecordCount;
  Value := myIBCQuery.Fields[Column.Index].Value;
  if (Column.Index = myIBCQuery.FieldCount - 1) and (Row < myIBCQuery.RecordCount) then
    myIBCQuery.Next;
end;

Post Reply