Subject Re: Cannot backup because file is being used
Author Adam
If you access the database via a file name, you will get an exclusive
lock on the file.

My guess is that the other application is doing this. There are two
options.

put it in the following format

[server name]:c:\path\to\database.fdb

server name should be the host name or static IP address of the
firebird server. You can use localhost or 127.0.0.1 with XP, but with
2003 and terminal server it sometimes does not work properly.

A better approach is to use aliases to separate the physical location
of the database file from the connection string. It means you can move
it without having to reconfigure each client.

in aliases.conf, add a line

MyDatabase=c:\mydata~1\program\data\database.fdb

(you can call it something else if you like).

Then just use the connection string

server:MyDatabase

This connection string should work on both the server and also on clients.

If you have the built in firewall switched on, you may need to create
an exception for port 3050 if you haven't already.

Adam

--- In firebird-support@yahoogroups.com, "Raith, Daniel"
<danielraith@m...> wrote:
> Ah, that path thing makes sense now. The server is running xp-pro, don't
> know what the OS is on the computer trying to run my batch file.
>
>
>
>
>
> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of Daniel Rail
> Sent: Friday, August 26, 2005 11:32 AM
> To: firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Cannot backup because file is being used
>
>
> Hi,
>
> At August 26, 2005, 11:18 AM, Raith, Daniel wrote:
>
> > I'm using 1.5.2.4731, super server, and when I try to perform a backup
>
> > I'm getting an error:
>
> > "Error while trying to open file"
> > "The process cannot access the file because it is being used by
> > another process."
>
> You can't access the same database file, via 2 different pathnames. In
> your case, your application references the file via the long pathname,
> and you are trying to use GBAK with the short pathname, which Firebird
> will recognize as 2 different databases. But, when trying to access the
> second pathname, it will find out that it can't because the file is in
> use by another application(which could be itself). This is a safeguard
> against data corruption.
>
> > Another funny thing about this setup is that the database is in a
> > directory that has spaces in the name. Originally I couldn't get the
> > backup to work because of it. For example: "c:\my
> > data\program\data\database.fdb" which I had to create a backup batch
> > file which read something like this.
>
> > Gbak.exe -b "c:\mydata~1\program\data\database.fdb"
> > "c:\mydata~1\program\data\database.fbk"
>
> > Otherwise I kept getting an error about specifying multiple sources or
>
> > something. Now I'm getting this other error.
>
> > Any ideas?
>
> I never had a problem with using the pathnames with spaces in them.
>
> Do you have the same error when running GBAK directly from the
> command-line, instead of from within a batch file?
>
> Also, which version of Windows are you using?
>
> --
> Best regards,
> Daniel Rail
> Senior Software Developer
> ACCRA Consultants Inc. (www.accra.ca)
> ACCRA Med Software Inc. (www.filopto.com)
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item on
> the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links