You can use default behavior to make a connection and leave some of the connection parameters unspecified. However, using the default behavior in a production environment can cause problems if the application is installed with other SQL Anywhere applications. If you are having problems connecting, explicitly specifying values instead of relying on defaults may resolve your problem.
It is recommended that you always specify the server name using the ServerName connection parameter especially if you are running an embedded SQL Anywhere server. See ServerName (Server) connection parameter.
The following list describes several common connection scenarios and the default client connection parameters that are required in each case.
Use the following connection string to connect to a named local server, using a named database:
ServerName=server-name;DBN=db-name;UID=user-id;PWD=password |
Use the default parameters to connect when you are sure that there is only one database server running on the local computer:
UID=user-id;PWD=password |
When you are sure that only one database server is running on the local computer, you can use the default server settings and specify the database you want to connect to:
DBN=db-name;UID=user-id;PWD=password |
If more than one database server is running on the local computer, specify which server you want to connect to. You do not need to specify the database name if only a single database is running on that database server. The following connection string connects to a named server, using the default database:
ServerName=server-name;UID=user-id;PWD=password |
The following connection string connects to a database running on the default database server that is running on a network computer. This connection string assumes that the database is using the default database name and that the database server is running on the default TCP/IP port 2638.
Host=host-name;DBN=db-name;UID=user-id;PWD=password;ServerName=server-name |
If the database server is not using the default TCP/IP port (2638), then you may not be able to connect if the server is on Mac OS X or if the database server was started using the -sb option. In these cases, you can specify Host=host-name:port-number to connect.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |