DatabaseName connection parameter [DBN]

Identifies a loaded database to which a connection needs to be made when connecting to a database that is already running.

If you want to connect to a database that is not running, use the DatabaseFile (DBF) parameter.

Usage

Running local databases or network servers

Values

String

Default

There is no default setting.

Remarks

Whenever a database is started on a server, it is assigned a database name, either by the administrator using the -n option, or by the server using the base of the file name with the extension and path removed.

You can only use the database name utility_db to connect to the SQL Anywhere utility database. See Using the utility database.

Note

The DatabaseName (DBN) connection parameter is recommended for naming databases, rather than using the -n option with the DatabaseSwitches (DBS) connection parameter.

If the database you want to connect to is already running, you should specify the database name rather than the database file.

A connection will only occur if the name of the running database matches the name that is specified in the DatabaseName (DBN) parameter.

Note

If you specify both the database file and the database name, an attempt is made to connect to a running database with the specified name (the database file is ignored), and if that fails, an attempt is made to autostart a database using both the database file and database name.

See also
Example

To start a database file named cities.db and rename the database Kitchener, you can use the following command:

dbeng11 cities.db -n Kitchener

Assuming you have run the above command, you can successfully connect to the running database named Kitchener as follows:

DBN=Kitchener

Alternatively, you could use the following to successfully connect to the running database named Kitchener:

DBN=Kitchener;DBF=cities.db

However, specifying the following would fail to connect to the database named Kitchener:

DBF=cities.db