DatabaseFile connection parameter [DBF]

Indicates which database file you want to load and connect to when starting a database that is not already running.

If you want to connect to an already-running database, use the DatabaseName (DBN) parameter.

Usage

Embedded databases

Values

String

Default

There is no default setting.

Remarks

The DatabaseFile (DBF) connection parameter is used to load and connect to a specific database file that is not already running on a database server.

  • If the database you want to connect to is not already running, use the DatabaseFile (DBF) connection parameter so the database can be started.
  • If the file name does not include an extension, SQL Anywhere looks for a file with the .db extension.
  • The path of the file is relative to the working directory of the database server. If you start the server from a command prompt, the working directory is the directory that you are in when entering the command. If you start the server from an icon or shortcut, it is the working directory that the icon or shortcut specifies. It is recommended that you supply a complete path and file name.
  • 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. The database server is not autostarted if the CommLinks [LINKS] parameter includes TCPIP.

You can also use UNC file names.

For more information about using UNC file names, see The SQL Anywhere database server.

It is recommended that deployed applications specify a database server name using the ServerName (ENG) parameter when attempting to autostart a database file if it is not already running. Otherwise, the application may connect to a different database server than intended. For example, the database server could connect to a different version of the SQL Anywhere server that is part of an embedded application and already running.

Caution

The database file must be on the same computer as the database server. Starting a database file that is located on a network drive can lead to file corruption.

See also
Examples

The DatabaseFile (DBF) connection parameter in the following example loads and connects to the sample database, demo.db:

DBF=samples-dir\demo.db

For information about samples-dir, see Samples directory.

The following two examples assume that you have started a database file named cities.db, and renamed the database Kitchener as follows:

dbeng11 cities.db -n Kitchener

To successfully start and connect to a database and name it Kitchener:

DBN=Kitchener;DBF=cities.db

Specifying DBF=cities.db would fail to connect to the running database named Kitchener.