Subject Re: [IBO] TIBO_Query creating Access Violation with fbclient.dll
Author Helen Borrie
At 04:12 PM 10/09/2003 +0000, you wrote:
>Hello,
>I am getting an EAcessViolation when trying to open a SQL sentence
>using a TIBO_Query. The message that i get is the following: Project
>ctswin.exe raised exception class EAccessViolation with
>message 'Access violation at address 011D264E in
>module 'fbclient.dll'. Read of address 00DCC000'. Process Stopped.
>Use Step or Run to continue.
>
>My environment is the following:
>fbserver.exe file version 1.5.0.3773
>fbclient.dll file version 1.5.0.3773
>fbclient.dll has been copied to gds32.dll

When you posted this before I wondered why you were getting an AV in
fbclient.dll. But now you say you "copied fbclient.dll to gds32.dll". You
need to get these libraries sorted out.

In the original Fb 1.5 installation, two dlls were installed into your
system directory: gds32.dll and fbclient.dll. That version of gds32.dll
is merely pointers to the functions in fbclient.dll.

1) The stub-version of gds32.dll is required, along with fbclient.dll, if
you want your existing IBO applications to work with Firebird 1.5. That is
the default way to use Fb 1.5 with your IBO applications.

2) An alternative is to move the stub-version of gds32.dll out of the path
and *rename* fbclient.dll to gds32.

3) Another alternative is to change your IBO apps so that they know to use
fbclient.dll *instead of* gds32.dll. There is a way to do that in IBO,
that has been discussed here before.

You needed to do ONE of the above. The three options are mutually
exclusive. What you have done seems to be an unworkable mix of 1) and 2),
such that (somehow) your ibo app and possibly some other app are calling
both libraries and causing memory protection errors.

Now, to comment on your code - although it is probably NOT your code errors
which are causing the Firebird client to AV.

>TIBOQuery package ibo40xdt_d5
>on the conf file of Firebird I changed the following parameter:
>OldParameterOrdering = 1
>
>
>the code which is originating the problem is the following:
>
>db is a DataModule.
>
>
> db.TIBOQuery.IB_Connection := db.TIB_Connection;

Do you really have a query named "TIBOQuery"?

> db.TIBOQueryIB_Transaction := db.TIB_Transaction;
> db.TIBOQueryIB.Prepared := false; <-- remove this. IBO sets the
> Prepared property to False when it is needed.
>
> if db.TIB_Transaction.InTransaction <-- what is "db.TIB_Transaction"?
> then db.TIB_Transaction.Commit;

> db.TIB_Transaction.StartTransaction; <--- as above, and wrong place
> to do this

// when assigning a new SQL statement, first CLEAR the old SQL. IBO will
unprepare the statement here.

db.TIBOQuery.SQL.Clear;

> try
> db.TIBOQuery.SQL.Add('SELECT * FROM TABLE WHERE SCHOOL = ' +
> '''' + SchoolCode + '''' +
> ' AND DISTNO = ' + IntToStr(DistNo) );
> db.TIBOQuery.Prepared := true; <--- remove this - IBO does it.

> db.TIBOQuery.Open; <====== error ocurrence
> Result := true;
>
> except
> db.TIB_Transaction.Rollback;
> // db.TIBOQuery.Unprepare; <--- remove this
> end;
>
>Any suggestions of how to solve the problem?

Yes. Begin by fixing up your Fb client installation. Use only one method
and HIDE any pieces you are not using. I recommend the default 1) for your
situation, because it avoids your having to make it an application
issue. I think that, for now, you already have enough other problems with
IBO, that you need to avoid adding an external dysfunction to the
situation. I verify that 1) is the setup I am using with IBO and it works
just fine.

After that, fix up your code.

Helen