Subject Re: Statement failed, SQLCODE = -904
Author elwin_ho
(I am new in firebird). It did work after I prefix the IP address,
Thanks.
SQL> create database '127.0.0.1:bbb.fda';
Commit current transaction (y/n)?y
Committing.
SQL> commit;


Is there any way I can set the server to not requiring prefixing the
IP address? As it works in most of machines, we put that in the build
script without the prefix. I need to fix this problem in my
development environment.

I am using Firebird 1.5.1 (Win32 Build)
in windows server 2003.


Thanks again.
Elwin


--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
>
> At 03:35 PM 18/01/2008, you wrote:
> >Hi,
> >I try to create a database in my local database by typing
following,
> >but keep getting errors.
> >C:\netchem\engine\DBSchema>..\..\vendor\Firebird\Server\bin\isql -
u
> >sysdba -p masterkey
> >Use CONNECT or CREATE DATABASE to specify a database
> >SQL> CREATE DATABASE 'bbb.fdb';
> >Statement failed, SQLCODE = -904
> >
> >unavailable database
> >
> >
> >Any one knows the why?
> >(I pretty sure the database server is ready and running. I use the
> >IBConsole to verify that by creating a new database.)
>
> One problem here, possible two (assuming the Firebird service is
running, of course. Check that by consulting the Services applet.)
>
> CREATE DATABASE is one SQL command but it involves multiple
actions. First the server has to create the *file* where the
database is to live and write some data that will become
the "database header page". So far, this is a file operation only.
>
> Then, once this headered file exists, it has to connect to it as a
database.
>
> So - while the filesystem-only part at the beginning is possible
using a relative file location, a full path to the database file is
required.
>
> In any case, it is a very bad idea to create databases in
Firebird's \bin\ directory. So make an area of your hard disk where
databases will live. Let's suppose you create a directory
named "data" on drive C for this.
>
> That makes the file-path for the new database 'C:\data\bbb.fdb'
>
> Now, if you are using Superserver *and* you are running isql in a
native command shell (not in a remote desktop client shell) you can
create your database this way:
>
> SQL> CREATE DATABASE 'C:\data\bbb.fdb';
>
> If you still get 'unavailable database' then either you are running
Classic server or isql is running in a RDT shell. Either way, you
must supply also the host name (or IP address) of the machine where
the server runs and specify the user name and password of the
database owner. So let's say your machine's network node name is
elwinsbox and your shell is an RDT client:
>
> Using TCP/IP:
> SQL> CREATE DATABASE 'elwinsbox:C:\data\bbb.fdb' user 'SYSDBA'
password 'whatever';
>
> Using WNET:
> SQL> CREATE DATABASE '\\C:\data\bbb.fdb' user 'SYSDBA'
password 'whatever';
>
> With Classic and a native command shell you can use the local
loopback server, "localhost" as the hostname (TCP/IP only):
> SQL> CREATE DATABASE 'localhost:C:\data\bbb.fdb' user 'SYSDBA'
password 'whatever';
>
> Anything else, you would need to provide better information about
your environment.
>
> Also, use the release notes and the Quick Start Guide as your
reference. The examples in the IB 6 manuals are very poor and often
just *wrong*; and they don't know about Classic on Windows at all.
>
> ./heLen
>