Subject Re: [IBO] error open
Author Gediminas
Helen,

At 2003.09.27 16:15, you wrote:
>No. SQL.Clear will clear everything (including buffers) and reconstruct
>field and parameter objects when the new SQL is prepared.

I have made test, so after ib_query->SQL->Clear() KeyLinks, FieldsVisible
are not reset to NULL (at least watch provides such behaviour)... maybe
some properties are not set for automatic cleaning

>The most likely cause is a ParamByName reference in your code, that refers
>to the old query contents. Other possible causes - presence or absence of
>required double quotes in SQL, ParamByName, FieldByName, KeyLinks,
>etc.; jumbled parameters caused by using Fb 1.5 without setting the
>server's OldParameterOrdering parameter to true (=1) in firebird.conf.

It would be great, that it would be the cause. Problema is such, that if I
set query properties after program start, there is ok - if I try to switch
to next query - error is shown, but if I set such query after the program
start, it works without problems (double quotes are ok in such case). So I
guess, that some properties are not cleared, but I use only 3 of them:
ib_query->SQL->Add()
ib_query->KeyLinks->Add()
ib_query->FieldsVisible->Add() <-- twice, as 2 columns are not shown
before preparing second query I clean (ib_query is not closed, as you
noted, that this isn't needed):
ib_query->SQL->Clear()
ib_query->KeyLinks->Clear()
ib_query->FieldsVisible->Clear()

>As a general rule (IMO) you are making a rod for your back by re-using
>dataset components. Create them in the IDE and keep them unprepared until
>(or in case) you need to use them. Of course, if you are potentially

that is exactly what I have done - put some TIB_Query components & alter
their properties when needed. Later will see, how to deal with report
integration




--/ Gediminas /--
The Truth Is Out There