Click or drag to resize

SqlGetProp Function (Long, Long)

X#
Retrieves the current or default settings for an active connection.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION SqlGetProp(
	nStatementHandle AS LONG,
	nSetting AS LONG
) AS USUAL
Request Example View Source

Parameters

nStatementHandle
Type: Long
Specifies the statement handle to the data source returned by SqlConnect( ). If you specify 0 for nStatementHandle, SqlGetProp( ) returns the environment setting.
nSetting
Type: Long
Specifies the setting. For a list of the settings you can specify see the SQLProperty Enum.

Return Value

Type: Usual
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.
Examples
X#
 1Close ALL
 2Clear ALL
 3Clear
 4nHandle=SqlConnect()
 5IF nHandle > 0
 6cSource= SqlGetProp(nHandle, "datasource")
 7=MessageBox("Current Data Source = "+cSource,0,"Connection Results")
 8ELSE
 9=MessageBox("Connection Error = " + ;
10ALLTRIM(STR(nHandle)),0,"Connection Results")
11ENDIF
12=SqlDisconnect(nHandle)
See Also