Subject How to create a database over a UNC path?
Author echawkes
Hi,

Sorry if this post is naive or redundant. I am new
to Firebird.


Summary
-------
We are having trouble creating a database on a drive
described by a UNC path. Firebird is not installed
over a UNC path, but we would like to keep the database
itself on a Network Appliance box for ease of backup, etc.

I have searched the newsgroups, etc. a bit, and it sounds
like this is unsupported. The most relevant posts I found
reference
http://www.volny.cz/iprenosil/interbase/connect_string.htm
http://groups.yahoo.com/group/firebird-support/message/48495

However, what we want to do seems like a fairly normal
thing for a database to support, so I wanted to make sure
whether this is supported or not.


Background
----------
We trying to incorporate Firebird v 1.5.1 into our product.
We plan to install Firebird at customer sites
in a standard location on PCs running Windows:
C:\Program Files\Firebird

However, we would like to create the database on a
NetApp drive via a UNC path. For example, if the
NetApp is called mthood, the path would be:
\\mthood\data\test.fdb

We would run processes that create and connect to
the database on the Windows PC via the Firebird C API.


Code I have tried
-----------------
If firebird is installed and running as a service
on a PC called gradgrind, a code fragment is:

char *createStatement = "CREATE DATABASE
'gradgrind:\\mthood\data\test.fdb'
user 'sysdba' password 'masterkey'"

// Create a new database with SQL dialect 3.
// There is no transaction for create database,
// so we don't start or commit the transaction.
// See page 325 of the Firebird API guide.
if (isc_dsql_execute_immediate(status, newdb, &trans, 0,
createStatement, SQL_DIALECT, NULL) != 0)
{
pr_error(status, "create database");
return false; // failure
}


I have also tried via isql, as follows:

SQL> CREATE DATABASE "gradgrind:\\mthood\data\test.fdb"
user 'sysdba' password 'masterkey';
Commit current transaction (y/n)?y
Committing.
Statement failed, SQLCODE = -902

Unable to complete network request to host "mthood".
-Failed to establish a connection.
-The system cannot find the path specified.
SQL>

The errors I get using the C API look similar:

PROBLEM ON 'create database'
Unable to complete network request to host "mthood".
- Failed to establish a connection.
- The system cannot find the path specified.\r\n
SQLCODE = -902, GDSCODE = 335544721


I have tried a few different variants of this incantation,
and I have tried their equivalents using isql as well,
but no luck.

I know Firebird is basically working fine because
this works correctly (using isql and the C API):

SQL> CREATE DATABASE "gradgrind:c:\tmp\test.fdb"
user 'sysdba' password 'masterkey';
SQL>

Is there any way to do this over a UNC path?
If so, any advice would be appreciated.


Thanks,

Eric