Connect to a server on a network

When connecting to a database running on a network server on a local or wide area network, the client software must locate and connect to the database server. SQL Anywhere provides a network library to handle this task.

Network connections occur over a network protocol. TCP/IP is available on all platforms.

A client connection to a network database server, showing the client using an Interface library to connect to a server running on the network.
Specifying the server

SQL Anywhere server names must be unique on a local domain for a given network protocol. The following example connects to a server running on a network:

ENG=svr-name
DBN=db-name
UID=user-id
PWD=password
CommLinks=all

When CommLinks=all is specified, the client library searches for a personal server with the given name, and then searches the network for a server with the given name. See CommLinks connection parameter [LINKS].

Specifying the protocol

To improve performance, you can instruct the network library which protocols to use. The following parameters use the TCP/IP protocol:

ENG=svr-name
DBN=db-name
UID=user-id
PWD=password
CommLinks=tcpip

The network library searches for a server by broadcasting over the network, which can be a time-consuming process. Once the network library locates a server, the client library stores its name and network address in a file (sasrv.ini), and reuses this entry for subsequent connection attempts to that server using the specified protocol. Subsequent connections are normally faster than a connection achieved by broadcast.

By default, all network connections in Sybase Central and Interactive SQL use the TCP/IP network protocol.

To connect to a database on a network server ( Sybase Central or Interactive SQL )
  1. Start Sybase Central or Interactive SQL.

    If the Connect window does not appear:

    • In Sybase Central, choose Connections » Connect With SQL Anywhere 11.

    • In Interactive SQL, choose SQL » Connect.

  2. Click the Identification tab.

  3. In the User ID field, type a user name.

  4. In the Password field, type a password for the database.

  5. Click the Database tab.

  6. In the Server Name field, type the name of the server or click Find.

  7. In the Database Name field, type the name of the database.

  8. Click OK.

See also