dbsetconnect

Description

Specify server connection information to use instead of directory services.

Syntax

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;

Parameters

service_type

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.

net_type

The name of the network protocol. Valid values are:

  • tcp” for TCP/IP – all UNIX platforms

  • decnet” for DECnet

net_name

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.”

machine_name

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

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.

Returns

SUCCEED or FAIL.

Usage

See also

dbopen