User's Guide
PART 1. Working with Databases
CHAPTER 2. Connecting to a Database
The Adaptive Server Anywhere connection parameters are listed in the following table.
For a full description of each of these connection parameters, see Connection and Communication Parameters.
Parameter |
Short form |
Argument |
---|---|---|
Agent |
Agent |
String (Any or Server) |
AutoStart |
AStart |
Boolean |
Autostop |
AStop |
Boolean |
CommBufferSize |
CBSize |
Integer |
CommBufferSpace |
CBSpace |
Integer |
CommLinks |
Links |
String |
ConnectionName * |
CON |
String |
DatabaseFile |
DBF |
String |
DatabaseName |
DBN |
String |
DatabaseSwitches |
DBS |
String |
DataSourceName |
DSN |
String |
Debug |
DBG |
Boolean |
DisableMultiRowFetch |
DMRF |
Boolean |
EncryptedPassword |
ENP |
Encrypted string |
Encryption |
ENC |
Boolean |
EngineName / ServerName |
ENG |
String |
FileDataSourceName |
FileDSN |
String |
Integrated |
INT |
Boolean |
LivenessTimeout |
LTO |
Integer |
Logfile |
LOG |
String |
Password ** |
PWD |
String |
StartLine |
Start |
String |
Unconditional |
UNC |
Boolean |
Userid ** |
UID |
String |
* Not used by ODBC connections
** Verbose form of keyword not used by ODBC connection parameters
Boolean values Boolean (true or false) arguments are either YES, ON, 1, or TRUE if true, or NO, OFF, 0, or FALSE if false.
Case sensitivity Connection parameters and their values are case insensitive.
The connection parameters used by the interface library can be obtained from the following places (in order of precedence):
Connection string Parameters can be passed explicitly in the connection string.
SQLCONNECT environment variable Connection parameters can be stored in the SQLCONNECT environment variable.
Data sources Parameters can be stored in ODBC data sources.
Compatibility data source A special data source is available for compatibility with SQL Anywhere Version 5 client/server connections.
Character set restrictions The server name must be composed of characters in the range 1 to 127 of the ASCII character set. There is no such limitation on other parameters.
For more information on the character set issues, see Connection strings and character sets.
Priority The following rules govern the priority of parameters:
The entries in a connect string are read left to right If the same parameter is specified more than once, the last one in the string is used.
If a string contains a data source or file data source entry, the profile is read from the configuration file, and the entries from the file are used if they are not already set. That is, if a connection string contains a data source name and sets some of the parameters contained in the data source explicitly, then in case of conflict the explicit parameters are used.
Connection parameters often provide more than one way of accomplishing a given task. This is particularly the case with embedded databases, where a database server is started by the connection string.
For example, if your connection will start a database, you can specify the database name using the DBN connection parameter or using the DBS parameter.
Here are some recommendations and notes for situations where connection parameters conflict:
Specify database files using DBF You can specify a database file on the Start parameter or using the DBF parameter. It is recommended that you use the DBF parameter.
Specify database names using DBN You can specify a database name on the Start parameter, the DBS parameter, or using the DBN parameter. It is recommended that you use the DBN parameter.
Use the Start parameter to specify cache size Even though you use the DBF connection parameter to specify a database file, you may still want to tune the way in which it starts. You can use the Start parameter to do this.
A particular example is if you are using the Java features of Adaptive Server Anywhere. In that case, you should provide additional cache memory on the Start parameter. The following sample set of embedded database connection parameters describes a connection that may use Java features:
DBF=path\asademo.db DBN=Sample ENG=Sample Server UID=dba PWD=sql Start=dbeng6 -c 8M