Subject Re: [firebird-support] How can I change the path to the database file?????
Author Helen Borrie
At 07:59 AM 23/06/2005 +0000, you wrote:
>Hello all,
>
>I have a Database Program (MaxControl2)and it uses firbird. When I
>install the program it installs all of its files in C:\MaxControl2.
>I can see the executable and the database file (Maxximus.GDB) along
>with .ddl's, Isu's, DAT's and other files it needs to operate. There
>are 2 configuration files, but they don't appear to offer any line
>item that allows you to change the location of the database file.
>
>Could it be that I just add a new section, example: [SYSTEM] then
>define my path?
>
>Is there a way to tell the program to look for its database file at
>\\My_Server\C:\MaxControl2?

Don't hard-code an database paths into your application, but use an alias
in your application.

On the production server, confgure that alias in aliases.conf. The path
*must* be the absolute path location as seen by the server - not a share
or a mapping.

The aliases.conf entry would be
MyAlias = C:\MaxControl2\Maxximus.GDB

Note that, even if path on your development system is different, your
application will still connect properly, provide you have the correct
database path configured on your development host server.

>Our company started out with 1 computer and we now need 3 computers
>to access the same database file.

Your client machines must access the host machine as a server. I see you
referring the Windows Named Pipes network protocol. In this case, your
application code must access the database in this form:

\\My_Server\MyAlias

However, Win Named Pipes is a very noisy protocol. You will get better
response if you use the TCP/IP protocol, which has this connection format
for your alias:

My_Server:MyAlias


>As I have already tried to figure a way to do this, I come up with
>ideas from the Unofficial Firebird Installation page at
>
>http://www.alanti.net/firebird/inst/index.html
>
>It appears that some sort of script might be able to help me?

I'm not familiar with this but it could be some kind of workaround
applicable to Firebird 1.0. With the Firebird 1.5 aliasing you don't need
any sort of script. You might prefer to write a script to set up the alias
correctly, though of course it is a quick and easy thing to do it manually,
if you know the path of the database file.

>Am I on the right track? Or lost?

Can't tell. :-)


>I have tried to follow the instructions to generate a script, but the
>script file is very complicated. If I am on the right track does
>anyone have an example script that can help me understand what all
>the paramerters are?
>
>Logically thinking, it seems i have to somehow fool, or redefine the
>program into thinking its database is in a different location.

I think the stuff you have read must be pretty old. Aliasing has been
available for v.1.5 all along.

./heLen