Sets the current database connection. Recommended for use when working with multiple database connections.
All consequent API calls made via DB API functions will be executed via this connection. When working with the default (primary) connection the call of this function is not required.
To switch back to primary connection call this function without arguments.
Syntax
DB.SetConnection(name)
Arguments
name
the connection name, as it appears in wizard.
Return value
No return value.
Example
// switch connection to Northwind
DB.SetConnection("Northwind");
// execute query
DB.Exec("update order set status='shipped' where OrderDate=CURDATE()");
// switch back to primary connection
DB.SetConnection("");
See also: