Subject | Re: [firebird-support] UNC to drive letter path |
---|---|
Author | Thomas Bachinger |
Post date | 2003-09-03T08:55:05Z |
Hi Martijn,
in a wrong way. I have the following scenario: my application works with two
databases: (1) a local database that resides by definition on the machine
where the application process runs (no problems with that), and (2) a global
database that can reside on any remote machine within the company network!
Both are firebird databases: and that means to me that I have to install a
firebird server on the client machine as well as on the remote machine
(or??)????
For my application to connect to and communicate with the global database
that resides on the remote machine I have to first retrieve the path to the
database location on the remote machine. To do that, the user has to
establish this connection the very first time he starts the application. He
can do this by using the Windows standard open dialog to choose a location
on a remote machine for the global database. The Windows open dialog however
always returns a UNC style path for the global database location on the
remote machine and I found it impossible to convert this UNC path
(server1\\path1\database.gdb) to the true drive letter path
(server1:E:\path1\database.gdb)... or in other words I could not find any
windows API method that tells me that 'path1' on 'server1' is on the 'E:'
drive. And unfortunately firebird requires (or better the IBX components in
Delphi7) require that one supplies exactly this local drive letter path
instead of the UNC path.
Another problem is that this UNC path may or may not be a share on the
client machine. When considering your words I almost read that I should not
allow for this global database to exist, namely I should always force the
global databse to be on the local machine? I however thougth that a database
server allows me to access a database that he has under his regime from any
client location within a company network? And if I hardcode the drive letter
path into the startup and connection code it works just fine,... its just
that I havn't found a way to extract this local drive letter path on the
first application start from a client location. However, I am not acquainted
with Firebird, so maybe I do the totally wrong thing here????
Best regards,
Thomas
> I wonder: what has an UNC path - which is a share, right? - to do with.. considering your words, I think that it might be that I use the Firebird
> the local path and connecting to a database? A UCN path is a _client_
> side thing, while a local path is a server side thing. Database files
> should not reside in shared folders.
in a wrong way. I have the following scenario: my application works with two
databases: (1) a local database that resides by definition on the machine
where the application process runs (no problems with that), and (2) a global
database that can reside on any remote machine within the company network!
Both are firebird databases: and that means to me that I have to install a
firebird server on the client machine as well as on the remote machine
(or??)????
For my application to connect to and communicate with the global database
that resides on the remote machine I have to first retrieve the path to the
database location on the remote machine. To do that, the user has to
establish this connection the very first time he starts the application. He
can do this by using the Windows standard open dialog to choose a location
on a remote machine for the global database. The Windows open dialog however
always returns a UNC style path for the global database location on the
remote machine and I found it impossible to convert this UNC path
(server1\\path1\database.gdb) to the true drive letter path
(server1:E:\path1\database.gdb)... or in other words I could not find any
windows API method that tells me that 'path1' on 'server1' is on the 'E:'
drive. And unfortunately firebird requires (or better the IBX components in
Delphi7) require that one supplies exactly this local drive letter path
instead of the UNC path.
Another problem is that this UNC path may or may not be a share on the
client machine. When considering your words I almost read that I should not
allow for this global database to exist, namely I should always force the
global databse to be on the local machine? I however thougth that a database
server allows me to access a database that he has under his regime from any
client location within a company network? And if I hardcode the drive letter
path into the startup and connection code it works just fine,... its just
that I havn't found a way to extract this local drive letter path on the
first application start from a client location. However, I am not acquainted
with Firebird, so maybe I do the totally wrong thing here????
Best regards,
Thomas