version 1.5
OC Set login option (login_ID; option_ID; option_Value) Longint
| Parameter | Type | Description | |
| login_ID | Longint | Login ID | |
| option_ID | Integer | Reference number for function | |
| option_Value | String | Value to set the option | |
| Function result | Longint | 1 = The operation succeeds | |
| 0 = An error occurs | |||
| -1 = option_ID is out of range |
Description
The OC Set login option function allows your application to set connection attributes.
login_ID must be a valid login ID.
option_ID is the reference number for the requested option. A list of reference numbers follows the description of this routine.
option_Value is the value to which the option will be set.
The reference numbers for option_ID are as follows:
| Descriptor | ID |
| SQL_ACCESS_MODE | 101 |
| SQL_AUTOCOMMIT | 102 |
| SQL_LOGIN_TIMEOUT | 103 |
| SQL_OPT_TRACE | 104 |
| SQL_OPT_TRACEFILE | 105 |
| SQL_TRANSLATE_DLL | 106 |
| SQL_TRANSLATE_OPTION | 107 |
| SQL_TXN_ISOLATION | 108 |
| SQL_CURRENT_QUALIFIER | 109 |
| SQL_ODBC_CURSORS | 110 |
| SQL_QUIET_MODE | 111 |
| SQL_PACKET_SIZE | 112 |
OC Set login option returns 1 if the operation succeeds, 0 if it fails, and -1 if option_ID is out of range.
Example
The following method sets the SQL_AUTOCOMMIT option (ID = 102) to manual (value = 0) and return the results in the $result variable.
$result:=OC Set login option(loginID;102;"0")
Particular case
The 103 (SQL_LOGIN_TIMEOUT) option allows you to set the timeout for all the future connections. It is not necessary to pass a valid login ID but you must pass a longint in loginID (to pass the correct number of parameters).
For example, OC Set Login option (LoginID;103;"20") allows you to set the timeout to 20 seconds.
To come back to the default driver value, you must pass "0" as the third parameter.
See Also