Subject | RE: [firebird-support] Strange behaviour with server name... |
---|---|
Author | Alan McDonald |
Post date | 2011-05-16T22:50:21Z |
> Hi,I'm
>
> I'm using Delphi 2010 and I'm accessing a Firebird 2.5 database using dbx.
> using the driver InterXpress for Firebird version 2.3.0.2.point
>
> Here is my problem:
>
> I have 3 computers A, B and C
>
> On computer A, there is a file alias.conf with the alias ALIAS_TEST that
> to the database c:\temp\database-a.fdb. This alias.conf file is located inmy
> program folder C:\MyFolder. Other FB embedded files are also located inthe
> that same folder.
>
> On computer B, FB server is running and there is an alias.conf file with
> alias ALIAS_TEST that point to the databasec:\anotherfolder\database-b.fdb
>with
> On computer C, FB server is also running and there is an alias.conf file
> the alias ALIAS_TEST that point to the databasec:\anyfolder\database-c.fdb
>in
> On computer A, there is also some network drives mapped on computers B
> and C as the folllowing:
>
> X: -> \\computerB\sharedfolderX
> Y: -> \\computerC\sharedfolderY
>
> From computer A, I'm accessing a local firebird database (database-a.fdb)
> using Firebird EMBEDDED. So, to do that, I do not specify any server name
> my connection. Here is an example of my connection parameters:is
>
> TSQLConnection.Params.Clear;
> TSQLConnection.Params.Add('user_name=sysdba');
> TSQLConnection.Params.Add('password=masterkey');
> TSQLConnection.Params.Add('Database=ALIAS_TEST');
> ...
>
> When I start my program from computer A, I can access my local database
> (ALIAS_TEST) using FB EMBEDDED without any problem. (What is important
> to know here is that the current directory is the folder where the program
> located. For example C:\MyFolder)using
>
> Now, while my programm is runnig, if I change the current directory (for
> example it change to X:\some_folder because I'm using a TopenDialog object
> somewhere into my program), if I try to reconnect to the local database
> FB EMBEDDED, the program try to connect to the ALIAS_TEST databaseto a
> located on the computer B (because X: is mapped on the computer B)
> instead of the ALIAS_TEST locally . If I change back the current directory
> local directory of the computer where the program is running from, I canwill try
> connect back to my local ALIAS_TEST database without any problem. Same
> problem if I change the current directory to Y:, that time the program
> to access the database ALIAS_TEST located on the computer C.sure
>
> So, it looks that when there is no server specified into parameters,
> something somwehre try to add one.
>
> I know it looks very strange but I have made several tests here and I'm
> about that behaviour.You can't use embedded to connect to mapped drives. They must be local. You
>
> So, since it cause me problems, could somebody help me about that and/or
> explain me about this behaviour?
>
> Is it possible that FB embedded try to detect and add some server name
> when none is specified?
>
> Thanks in advance.
>
> Guylain Plante
> OroLogic Inc.
can do some trickery to make this work but it is not advised.
If you want to connect to a remote server, you must provide the server name
and the alias as a minimum.
Alan