Page 1 of 1

Connection parameters for database on network server

Posted: Fri 27 Jan 2012 01:48
by softsmith
Firebird version : 2.5

I would appreciate any help with knowing how to connect to a database on a network computer.

My Delphi development computer has a machine name of XE2
When I work on that machine, I set the parameters for IBCConnect as follows

Code: Select all

With DM.IBCConnect do begin
  LoginPrompt := false;
  Server := 'localhost';
  Username := 'SYSDBA';    
  Password := 'masterkey';  
  Database := 'C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\employee.fdb';
end;
TblTest.Open;
This works with no problems on the local machine.

I then change the Server parameter from 'Localhost' to '\XE2'
I then share the folder that the exe has been compiled into.
I then go to another computer on the network, and run the exe on the shared folder from there. The application opens OK. But when I try to connect to the database, I get an error message - Unable to complete network request to host "XE2:C:".
Failed to establish a connection
The network name cannot be found

For a long time I thought that there was a problem with my network, but I have checked everything that I can think of. I have no problem pinging XE2 from the client machine, and I can run the application on XE2 from the client machine with no problem. It is only when I try to connect to the database that I have a problem.

Can someone tell me if my connection parameters are correct, and if not, what they should be. ( I have tried various other combinations of database and server, but I think what I have above is the closest answer)

Thanks for any help with this problem

Posted: Fri 27 Jan 2012 09:24
by AndreyZ
Hello,

You must not put the "\" characters to the Server property. To solve the problem, you should set the Server property to "XE2". Here is an example:

Code: Select all

With DM.IBCConnect do begin 
  LoginPrompt := false; 
  Server := 'XE2'; 
  Username := 'SYSDBA';    
  Password := 'masterkey';  
  Database := 'C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\employee.fdb'; 
end; 
TblTest.Open;

Posted: Fri 27 Jan 2012 13:15
by softsmith
Many thanks for you help. That fixed the problem!

Posted: Fri 27 Jan 2012 13:33
by AndreyZ
If any other questions come up, please contact us.