connect

Establishes a database connection.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

void connect(id[,connect-string])
int          id
string       connect-string

Description

Establishes a connection to a database with the specified id, using the specified connect-string. If the function is successful, the connection becomes the active database.
id identifies the connection. Valid values are 0 through 15. Only ids 0-3 can be used with VORTEXaccelerator or in conjunction with the net.ini file.

connect-string (optional) specifies the connect string to use for the database connection. If no connect-string is specified, the previously established connection identified by id becomes the active connection.

Notes

DesignVision Users Guide details the connect string syntax.

Example

Displays a list from an Rdb database based on data from an Oracle database:
{
connect(db_oracle,"niklas/back");
connect(db_rdb,"salary_data");
.
.
connect(db_oracle);
L1 = list_open("SELECT name FROM staff",1000,"Staff");
list_view(L1,0);
connect(db_rdb);
L2 = list_open("SELECT sal FROM personnel "
               "WHERE name = &/list_curr(L1,0)/",1,"Salary");
.
.
}