Subject Re: [IBO] [OT] IBO / Firebird1.5 can't work with remote DB
Author Andreas Bednarek
Hi Helen and Daniel,

> Are you using multiple threads in your application?

Yes I do, but NOT before the database problem occurs for sure.

>Also check to make sure the client has the server name and the proper
>static IP address in the HOSTS file.

I only found a 'hosts' file in 'Windows\System32\Drivers\etc'. If this is
the file it only contained an ' localhost', so I added the
' andris', but this doesn't seem to have an effect, nor after

>It sounds almost as if the database connection is not being made before the
>datasets are opened. Take a look at the CreationOrder and make sure that
>the IBODatabase gets created before the query objects.
>Are you doing this in your FormCreate?

Let me explain. Well, the TIBODatabase was really created at last. I moved
it to be created before the other components (there are just TIBOTable and
TIBOQuery then), but it didn't help. Actually all the components are placed
on a form called FormData, which is in the list of automatically created
forms. AFTER they are created I make a first call to OpenDatabase which
looks like this (slightly modified that you can see the values being set):

procedure OpenDatabase;
with FormData.DatabaseFPNet do
if not Connected then begin
Username := 'SYSDBA';
Password := 'masterkey';
DataBaseName := 'C:\Program files\FPNet1\FPNet1_Data.fdb';
Protocol := cpTCP_IP;
Server := 'andris';

And AFTER that, if a user succesfully Logins to my app for which I use table
'ADMINS' from that remote DB, which I can access well (!!) and it is closed
after the Login procedure again, there is a call to ProgramInitialize, where
the rest of the tables are being opened and the error occurs right on the
first attempt to open a table (namely 'UNITS_V119'). I'm 100% sure I do not
somehow close the database inbetween, also the property
DatabaseFPNet.Connected remains true.

As I said calling WSAStartup() after a table was closed and before opening
another one makes all the thing work.

Any other idea? I really appreciate you're trying to help. This is maybe not
much fun.


I include the definition of my TIBODatabase and one TIBOTable from the
FormData.DFM file. All the other tables and queries look exactly the same
except TableName and Left,Top properties of course.

object DatabaseFPNet: TIBODatabase
SQLDialect = 3
Params.Strings = (
Left = 40
Top = 96
object TableUnits: TIBOTable
IB_Connection = DatabaseFPNet
RecordCountAccurate = True
TableName = 'UNITS_V119'
FieldOptions = []
Left = 72
Top = 216