Subject Re: [firebird-support] UNC to drive letter path
Author Thomas Bachinger
Hi Florian,

> the client, your application, must find the database which has to reside
> physically on the same machine where the server process is running. In
order
> to find it, you have several possibilities:
> 1.
> You can share the whole driveletter of the server where the databasefile
can
> be found so that the client can find it by means provided by Windows.
Since
> this only gives you the path as UNC-path, you have to convert it at the
> client to something the client can work with.
> In Delphi, this would look like this:
>
> function TrimServerPath(PathName: string): string;
> begin
> //UNC Path looks like this: \\Server\DriveLetter\SD\SD\File
> //We need this: Server:DriveLetter:\SD\SD\File
> PfadName := StringReplace(Pfadname, '\\', '', []);
> PfadName := StringReplace(Pfadname, '\', ':', []);
> PfadName := StringReplace(Pfadname, '\', ':\', []);
> Result := PfadName;
> end;

... Ok, maybe I have overlooked something here: because when I retrieve a
UNC path I do NOT get the drive letter delivered with it as in your case
\\Server\DriveLetter\SD\SD\File ... in my case I get \\Server\SD\SD\File
instead... so I do not get the chance to rebuild myself the path as you
describe it here. Is there a set of options one can supply to the windows
open dialog for it to send the local drive letter with it...?? If so this
would be the simplest solution and would solve my problem immediately...!


> As for your plans of using both a local and a remote server, the only
thing
> what comes to mind is to manually switch on and off your local server
> whenever needed to work locally.

... I have tested the whole system by hardcoding the global database path
into the application (close to your proposed scenario Nr 2) and it works
just fine with both firebird servers on the company network. You instead
propose to switch the local server on and off, so I read from your lines
that you think that more than one firebird server being present in a network
might cause problems (event thought they manage different databases)???

Thanks,
/Thomas