Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Sybase DB Library C 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

  1                    dbsV
e
e
t
c
r
o
s
i
n
n
o
e
n
c4
t
.0 -(
-
O5
S
/1
2
,
/
89
M
S-DOS and Macintosh only) ______________________________________________________________________ NAME: dbsetconnect (OS/2, MS-DOS and Macintosh only) FUNCTION: Allocate and initialize a network connection structure. SYNTAX: RETCODE dbsetconnect(service_type, net_type, net_name, machine_name, port) char *service_type; char *net_type; char *net_name; dbsetconnect (OS/2, MS∀D
e
®S
s
ia
o
nd4.
M
0
a
c-
i
πt5
o
/
s
1
h
/8
o
9
n
ly) 2 ______________________________________________________________________ char *machine_name; char *port; COMMENTS: o This routine allocates and initializes a network connection structure. It provides an alternative method by which an application can specify the parameters required to open a con- nection to a SQL Server. o dbsetconnect() supersedes the interfaces file mechanism, described on the dbsetifile manual page and in the SYBASE Installation Guide. If dbsetconnect() has not been called, dbopen() uses the interfaces file to determine the proper SQL Server to connect to. o When you use dbsetconnect() to specify the SQL Server, you should set the second dbopen() parameter, server, to NULL. If dbopen() receives a non-NULL server name, it will use the 3 dbsV
e
e
t
c
r
o
s
i
n
n
o
e
n
c4
t
.0 -(
-
O5
S
/1
2
,
/
89
M
S-DOS and Macintosh only) ______________________________________________________________________ interfaces file mechanism, instead of dbsetconnect(). o Here's a program fragment that uses dbsetconnect() and dbo- pen(): DBPROCESS *dbproc; LOGINREC *loginrec; loginrec = dblogin(); DBSETLPWD(loginrec, "server_password"); DBSETLAPP(loginrec, "my_program"); dbsetconnect("query", "tcp", "sun-ether", "rose", "1025"); dbproc = dbopen(loginrec, NULL); PARAMETERS: service_type - The type of service you what. Usually, it is "query". dbsetconnect (OS/2, MS∀D
e
®S
s
ia
o
nd4.
M
0
a
c-
i
πt5
o
/
s
1
h
/8
o
9
n
ly) 4 ______________________________________________________________________ net_type - The type of network you want. The name you supply must be one of the types recognized by DB-Library, such as "tcp", "decnet", or "nmpipe". If an invalid net_type is sup- plied, calls to dbopen() will fail. net_name - The type of network media you use. The name you sup- ply must be one of the recognized types, such as "sun-ether", "pyramid-ether", "dec-ether", or "nmpipe-ether". machine_name - The name of the machine on which SQL Server resides. port - The port to which the application will connect. When the application is connecting to UNIX systems, for example, port is a socket number. RETURNS: SUCCEED or FAIL. dbsetconnect() returns SUCCEED if everything went well. It returns FAIL if a structure couldn't be created or 5 dbsV
e
e
t
c
r
o
s
i
n
n
o
e
n
c4
t
.0 -(
-
O5
S
/1
2
,
/
89
M
S-DOS and Macintosh only) ______________________________________________________________________ initialized. ERRORS: dbsetconnect() will return FAIL if the following is true: SYBEMEM Unable to allocate sufficient memory. SEE ALSO: dbopen, dbsetifile

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026