Specify server connection information to use instead of directory services.
RETCODE dbsetconnect(service_type, net_type, net_name, machine_name, port) char *service_type; char *net_type; char *net_name; char *machine_name; char *port;
The type of connection. Default values are:
“master” specifies a master line, which is used by server applications to listen for client queries.
“query” specifies a query line, which is used by client applications to find servers.
The name of the network protocol. Valid values are:
“tcp” for TCP/IP – all UNIX platforms
“decnet” for DECnet
Descriptor of the network. Open Client and Open Server do not currently use net_name; it is a placeholder should Sybase need to define this information in the future. For TCP/IP networks, the net_name is set to “ether.”
The network name of the node, or machine, that the server is running on. The maximum number of characters for machine_name depends on the protocol specified in the entry:
For TCP/IP, the maximum is 32.
For DECnet, the maximum is 6.
Use the /bin/hostname command on UNIX platforms to determine the network name of the machine you are logged in to.
Port used by the server to receive queries. The TCP/IP and DECnet protocols specify this element differently:
TCP/IP: Registered port numbers range from 1024 to 49151. Sybase recommends to use a port number from this range.
DECnet: Valid object numbers range from 128 to 253. Object names are also valid.
Use the netstat command to check which port numbers are in use.
SUCCEED or FAIL.
This routine lets the application specify connection information such as service type, network protocol type, network name of the server, server name, and port number required to connect to the server. This connection information is used for every subsequent call to dbopen.
If dbsetconnect is used, DSQUERY and normal directory services lookup for a server entry is bypassed.
If dbsetconnect has not been called, the connection information is found using directory services. The default directory service is the interfaces file for UNIX and the sql.ini file for Windows. Other directory services may be specified using the configuration file, libtcl.cfg.
See the Open Client and Open Server Configuration Guide.