Subject | Error opening table with fields inserted at runtime |
---|---|
Author | Mauro Rocha |
Post date | 2015-01-08T11:44:54Z |
Hello.
I'm using IBO 5.5.5_2152 with Delphi XE5.
Mauro.
I'm trying to insert fields in a TIBOQuery object like this:
Query1.SQL.Text := 'select ... from ... where ...';
// add existing fields
Query1.FieldDefs.Updated := false;
Query1.FieldDefs.Update;
Query1.Fields.Clear;
for i := 0 to Query1.FieldDefs.Count - 1 do
Query1.FieldDefs[i].CreateField( Query1 );
So far, OK. But right after that, if I run the following statement:
Query1.Active := true;
It shows an error like "Query1: Type mismatch for field '...', expecting: String actual: Unknown.".
If I add the fields inside Query1 manually from the IDE, it runs OK, but in my case the select can have many options, so I don't want to have a different IBOQuery for each possible one.
Best regards.