CreateConnectionID - cCLIHandler
(Obsolete) Creates a DataFlex Connection ID
Type: Function
Return Data Type: Integer
Parameters
| Parameter | Type | Description |
|---|---|---|
| sID | String | The ID that will be used to identify this connection. |
| sConnStr | String | The actual connection string. |
| iOpt | Integer | This argument indicates if silent login logic must be applied when logging into the connection. If the argument has the value 1, silent login is applied, if it is 0, silent login is not applied. If the argument is not passed (optional argument), it is assumed to be 0. |
Syntax
Function CreateConnectionID String sID String sConnStr Integer iOpt Returns Integer
Call Example
Get CreateConnectionID sID sConnStr iOpt to IntegerVariable
Description
(Obsolete)
As of DataFlex 19.0, Connection Ids are handled via Managed Connections, making this method obsolete. All of these techniques still work, but they have been replaced with better techniques that are also managed via the Studio and other DataFlex tools. See the cConnection class and Managed Connections for more.
To create a connection ID to connect to the Order database on the local SQL Server using the SQL Server Connectivity Kit, one could use the following code:
Procedure CreateMyID
Integer iResult
Handle hoCLI
Get Create U_cCLIHandler to hoCLI
If (hoCLI <> 0) Begin
Set psDriverID Of hoCLI To "MSSQLDRV"
Get CreateConnectionID of hoCLI "MyID" ;
"SERVER=(local);Trusted_Connection=yes;DATABASE=Order" ;
1 to iResult
If (iResult) ;
Showln "Something went wrong..."
Else ;
Showln "Connection id created"
End
End_Procedure
See Also
DataFlex Connection IDs | Silent Login
Return Value
CreateConnectionID returns 0 if the connection ID was created successfully, a non zero value otherwise.