OC Set login option

4D - Documentation   Français   English   German   4D ODBC, Command Theme List   4D ODBC, Command Alphabetical List   Back   Previous   Next

version 1.5


OC Set login option (login_ID; option_ID; option_Value) Longint

ParameterTypeDescription
login_IDLongintLogin ID
option_IDIntegerReference number for function
option_ValueStringValue to set the option
Function resultLongint1 = 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:

DescriptorID
SQL_ACCESS_MODE101
SQL_AUTOCOMMIT102
SQL_LOGIN_TIMEOUT103
SQL_OPT_TRACE104
SQL_OPT_TRACEFILE105
SQL_TRANSLATE_DLL106
SQL_TRANSLATE_OPTION107
SQL_TXN_ISOLATION108
SQL_CURRENT_QUALIFIER109
SQL_ODBC_CURSORS110
SQL_QUIET_MODE111
SQL_PACKET_SIZE112

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

OC Get login option.


4D - Documentation   Français   English   German   4D ODBC, Command Theme List   4D ODBC, Command Alphabetical List   Back   Previous   Next