Retrieves the current or default settings for an active connection.
SQLGETPROP(nStatementHandle, cSetting) |
Parameters
- nStatementHandle
- Specifies the statement handle to the data source returned by SQLCONNECT(В ). If you specify 0 for nStatementHandle, SQLGETPROP(В ) returns the environment setting.
- cSetting
- Specifies the setting. For a list of the settings you can specify, see SQLSETPROP(В ) Function.
Return Value
Character, Numeric, or Logical data type. SQLGETPROP(В ) returns the current or default settings for an active connection. SQLGETPROP(В ) returns -1 if a connection level occurs and -2 if an environment level error occurs.
Example
The following example uses SQLCONNECT(В ) to display the Select Connection or Data Source Dialog Box. Choose a data source, the data source connection is tested, and the example displays the results using SQLGETPROP(В ) and the cSetting for the data source.
В | Copy Code |
---|---|
CLOSE ALL CLEAR ALL CLEAR nHandle=SQLCONNECT() IF nHandle > 0 cSource= SQLGETPROP(nHandle, "datasource") =MESSAGEBOX("Current Data Source = "+cSource,0,"Connection Results") ELSE =MESSAGEBOX("Connection Error = " + ; ALLTRIM(STR(nHandle)),0,"Connection Results") ENDIF =SQLDISCONNECT(nHandle) |