views:

266

answers:

2
+2  Q: 

Firebird aliases

I have developed an application using Delphi and Firebird 1.5, where the server is located on the same machine as the application. I am now deploying the application to another site, where the Firebird server (Superserver) is running on one machine (NT4) whilst the client is running on another machine.

The application can connect to the database if I include the qualified path in the application ('t:\db\cinema.gdb'), but naturally I would prefer to use an alias, so that the same code will work on my development machine (with the local server).

So, two questions: 1. Where should the 'aliases.conf' file exist - on each machine along with the application, or on the server? 2. What should the alias be? "cinema = t:\db\cinema.gdb", assuming that the database is on a mapped drive t? "cinema = 192.168.2.121:f:firebird\db\cinema.gdb", using the IP address of the server and the path to the database as the server sees it?

TIA, No'am

+4  A: 

1.) The alias file only exists on the server! 2.) The alias maps directly to the file, e.g. cinema = c:\firebird\db\cinema.fdb. Don't use a mapped drive, this decreases performance. The client connects with database name 'servername:alias'.

Bye, Marcel

Marcel
Should I use the string 'localhost:cinema' in the application? I assumed that 'localhost' means the local computer, not the remote server.
No'am Newman
+1  A: 

The aliases.conf should be on the server only. And you should always use the full address, with the IP and the full path to the database on the server. Since drive mappings may change (and they always do when you least expect it) it is seldom a good idea to use them as a reference to files or databases that should be in a fixed location. Personally I do not use aliases at all in my C++Builder / Firebird application but just set up the full path in the programs ini file or as a registry entry (on the client side of course). The ini-file is there anyway and I do not create another dependency on the aliases.conf file.

Cees Meijer
I had considered the ini file option but thought it a work around. This would also have to be set for every user, whereas the alias file serves for everyone - No'am.
No'am Newman