Subject Re: [IBO] [OT] IBO / Firebird1.5 can't work with remote DB
Author Helen Borrie
At 05:06 PM 23/10/2003 +0200, you wrote:

>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;
>begin
> with FormData.DatabaseFPNet do
> if not Connected then begin
> Username := 'SYSDBA';
> Password := 'masterkey';



> DataBaseName := 'C:\Program files\FPNet1\FPNet1_Data.fdb';

This is wrong:

should be
Path := 'C:\Program files\FPNet1\FPNet1_Data.fdb';
> Protocol := cpTCP_IP;
> Server := 'andris';
> Connect;
> end;
>end;

The DatabaseName property is 'andris:C:\Program files...etc. but don't set
it yourself.

>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.

Yes: I can see what the problem is. You have remote clients trying to use
Windows-local connect. Just fixing that Path property will do it. Don't
set DatabaseName - IBO will construct that for you.

>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 = (
> 'SQL DIALECT=3')
> Left = 40
> Top = 96
> end
> object TableUnits: TIBOTable
> IB_Connection = DatabaseFPNet
> RecordCountAccurate = True
> TableName = 'UNITS_V119'
> FieldOptions = []
> Left = 72
> Top = 216
> end

Just one thing: do you have a default character set in your
database? Your TIBOTable would crash if you do, because you are not
setting the client character set here - or are you perhaps doing that
somewhere in the code, before connecting?

Helen