Subject Re: [IBO] Saving and loading queries FieldIndex and FieldDisplayWidth values
Author Elmar Knoerzer
Hallo Andreas,
in the moment it runs only in a test application.

I took a bigger project and changed a TIB_Query to my TIBGridQuery.
Here in the doBeforeClose i get an error 335544374 "Internal Schema
Cache Error" in IB_components line 14518.

public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure doBeforeOpen; override;
procedure doBeforeClose; override;
...
procedure TIB_GridQuery.doBeforeClose;
begin
inherited;
if FGridSave then
begin
ibSQL := TIB_DSQL.Create(self);
with ibSQL do
begin
DatabaseName := self.DatabaseName;
IB_Connection := Self.IB_Connection;
SQL.Text := ('EXECUTE PROCEDURE SET_QUERY_SETTINGS (?I_FORM,
?I_QUERY, ?I_FIELDSINDEX, ?I_FIELDSDISPLAYWIDTH, ?I_ORDERIITEMNO)');
ParamByName('I_FORM').AsString := FormName;
ParamByName('I_QUERY').AsString := QueryName;
ParamByName('I_FIELDSINDEX').AsString :=
self.FieldsIndex.CommaText;
ParamByName('I_FIELDSDISPLAYWIDTH').AsString :=
self.FieldsDisplayWidth.CommaText;
ParamByName('I_ORDERIITEMNO').AsInteger := self.OrderingItemNo;
Execute;
Free;
end;
end;
end;
...


In a small sample application it runs.

Regards Elmar


--- In IBObjects@yahoogroups.com, Andreas Pohl <apohl@...> wrote:
>
> Hallo Elmar,
>
> > i found the following solution.
>
> fine. But consider that your approach will cover TIB_Grid only. If
> you're working on TIB_Connection/TIB_Query level so you can work with
> all visual IBO controls. I especially think about FieldsLabel etc. - if
> you really need this ;)
>
> --
> Andreas
>