Subject | Re: [IBO] [OT] IBO / Firebird1.5 can't work with remote DB |
---|---|
Author | Huw jones |
Post date | 2003-10-24T08:01:29Z |
Andris, your database connection string will probably use local connection
rather than IP, use 127.0.0.1:C:\Program files\FPNet1\FPNet1_Data.fdb
as your connection string.
Regards
Huw.
the file it only contained an '127.0.0.1 localhost', so I added the
'192.168.132.19 andris', but this doesn't seem to have an effect, nor after
restart...?
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';
Protocol := cpTCP_IP;
Server := 'andris';
Connect;
end;
end;
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.
Andreas
P.S.
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
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
rather than IP, use 127.0.0.1:C:\Program files\FPNet1\FPNet1_Data.fdb
as your connection string.
Regards
Huw.
>>> "Andreas Bednarek" <andris@...> 10/23 4:06 pm >>>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 properI only found a 'hosts' file in 'Windows\System32\Drivers\etc'. If this is
>static IP address in the HOSTS file.
the file it only contained an '127.0.0.1 localhost', so I added the
'192.168.132.19 andris', but this doesn't seem to have an effect, nor after
restart...?
>It sounds almost as if the database connection is not being made before theLet me explain. Well, the TIBODatabase was really created at last. I moved
>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?
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';
Protocol := cpTCP_IP;
Server := 'andris';
Connect;
end;
end;
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.
Andreas
P.S.
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
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/