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.
Firebird 2 - TIBCLoader - Boolean
-
Jean-Christophe
- Posts: 5
- Joined: Thu 10 Oct 2013 09:42
Re: Firebird 2 - TIBCLoader - Boolean
I was using "LoadFromDataset", but using "Load" with "OnGetColumnData" did the job, while locating myself the data like this :
Is locating the rec number the good way, or does it take too much time for the procedure to be efficient ?
Code: Select all
if Row<>myIBCQuery.RecNo then myIBCQuery.RecNo := Row;Re: Firebird 2 - TIBCLoader - Boolean
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:
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;