Subject Re: [firebird-support] Embedded Database connect -904, "unavailable database?
Author Helen Borrie
At 10:41 AM 14/05/2006, you wrote:
>Does anyone know what caused error -904, "unavilable datbase" error?
>I can connect to the embedded database file D:\Databasess\Test.fdb" on
>a stand alone application, but when I cut-and-paste the code into a
>DLL such that the DLL will connect to the file database upon first
>function call
> if (m_pDb == NULL)
>I used the isc_expand_dpb() api to define the userId and password,
>then I use isc_attach_database to attach to the database, there is
>where I got the -904 error, which is "unavailable database?

It probably means that the client that your app is connecting to
can't find a server. Which client version is the app loading?

>What did I do wront, since my Test.exe works fine using the database file?

It's worthwhile to understand that there is no such thing as "an
embedded database". The "embedded server" model (fbembed.dll) is a
single instance of fbclient.dll that connects to a single (embedded)
instance of the Superserver. This client can connect to multiple
databases but

a) it needs exclusive access to the database[s] in order to do so
b) once it has connected to a database, no other client can connect
to that database

Make your client load fbembed.dll and ensure that there is no
hostname in the connection string.