Subject Re: Embedded Database connect -904, "unavailable database?
Author Jeff Lynn
Thanks, Helen,

I am using FB 1.5.3 and the stand-alone test app had been compiled to
link to the renamed DLL to FBClient.dll and using the FBClient.lib.
I am runing only one single application when using the Test
application, no other application is running, no Firebird server
running as well. It works in my Test app. But my second test app
that call a custom DLL, which then connect to the database file
without using any host string, just like the single test applcation
and using the attach API with the file name "D:\Databases\Test.fdb" only.

Since it did not work in my DLL, I wonder what else did I missed that
cause it not to find the database or somehow cannot get exclusive use
of the database file? I am sure no other application is running other
than my Test appl that call the DLL.

--- In, Helen Borrie <helebor@...> wrote:
> 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
> and
> 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.
> ./heLen