SQLSetConnect - cSQLHandleManager
Can be used to set up a default driver and connection for subsequent SQLConnect function calls.
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| sDriver | String | Driver IdCan be:ConstantMeaning |
| sConnect | String | Connection string |
Syntax
Procedure SQLSetConnect String sDriver String sConnect
Call Example
Send SQLSetConnect sDriver sConnect
Description
The procedure can be used to set up a default driver and connection for subsequent SQLConnect function calls. See SQLConnect for a discussion of when the defaults are used.
Sample
If, for example, we want to create two managers, one for DB2 and one for SQL Server, we could use the following code:
Handle hoDB2Mngr hoMSSQLMngr
Handle hdbcDB2 hdbcMSSQL
Object oDB2Handler Is A cSQLHandleManager
Move Self To hoDB2Mngr
End_Object // oDB2Handler
Object oMSSQLhandler Is A cSQLHandlemanager
Move Self To hoMSSQLMngr
End_Object // oMSSQLHandler
Send SQLSetConnect Of hoDB2Mngr "DB2_DRV" "DSN=MyServer"
Send SQLSetConnect Of hoMSSQLMngr "MSSQLDRV" "SERVER=(local)"
Get SQLConnect Of hoDB2Mngr "" "" To hdbcDB2
Get SQLConnect Of hoMSSQLMngr "" "" To hdbcMSSQL