Subject Re: [firebird-support] Database on Shared Folder - Cannot attach to password database error
Author Helen Borrie
At 23:13 27/08/2008, you wrote:
>Hi to all,
>
>i'm trying to get working an application that uses firebird as data
>backend. This application, instead to use a single firebird instance
>on a machine to share databases it, use an instance of firebird per
>machine (installed as super server) with the database located on a
>shared folder.

This will not work.


>A week ago, the developer of this application installed to a my
>customer this software in a network and on a machine it doesn't work
>correctly.
>
>With 1.5 it says "cannot attach to password database" with his
>application and isql too ... this is the output:
>SQL> CONNECT k:\contab\ken_contab.fdb user SYSDBA password masterkey;
>Statement failed, SQLCODE = -902
>
>cannot attach to password database
>
>Using firebird 2.0 or 2.1 i get another error, something like I/O
>Error over file !ken!\contab\ken_contab.fdb.
>
>The database file reside on k:\contab\ken_contab.fdb and the shared
>folder name is ken on a computer called PC1.

It is a totally wrong installation. Firebird is not fileserver software.

Install *one* instance of the Firebird server on the machine that is to be the database server host. The database must be on *that* machine and accessed only by the server.

Install the application on the individual machines. The application must connect as a client, through the Firebird client, fbclient.dll, which must be on each client machine. They will use TCP/IP to connect to the server using the same connection string, as for example

ourhost:c:\contab\ken_contab.fdb

"ourhost" here is the network node name of the host machine. You can alternatively use the host machine's local IP address, if it is known.

The database path can be ONLY the true physical path - never a share or a mapped device of any kind.

>Copying all the stuff on a local folder all works perfectly: no errors!

Of course. It is possible to have a local client.


>I know that this application do a strange stuff to use the database,
>but he says that he ever installed the application and he never got
>problems.

Don't believe him. Firebird cannot connect to databases on shares. Furthermore, multiple server instances cannot serve the same database simultaneously. Both of these restrictions are "by design".

>The network stuff of the machine works perfectly because
>there are a lot of shared folders used by other softwares and used for
>datas.

Sure. But shared folders are for sharing files. The database is a *database*. On Windows, it happens to live in a file. On other platforms, a database can live on a raw disk partition that is not part of the filesystem at all.


>I've looked around, but i haven't found a valid solution for my problem!

Read the Quick Start Guide. It should be in Firebird's \doc\ directory. If it is not there, download it from the Documentation Index at the firebirdsql.org website. At least that will help you to understand the client/server model and provide some connection examples.

>note: it's not a permission problem, i think at least, beacuse i
>enabled all on the shared folder and it continue to don't work

Forget "sharing". A database file should not even be in a shared folder. You must remove all network shares for it.

>Thanks to all for the help, this is my first time with firebird

It is not a propitious start to have to deal with such a wrong installation. Firebird is client/server software. Firebird server and one or more databases on ONE server machine, users submitting requests to the server across a network for connection. The "password database" is called security.fdb under Fb 1.5. It is (and must be) in Firebird's root directory.

./heLen