Click or drag to resize

SQLGetDataSources Function

X#
Identify the available ODBC data sources.

Namespace:  XSharp_VOSQLClasses
Assembly:  XSharp.VOSQLClasses (in XSharp.VOSQLClasses.dll) Version: 2.21
Syntax
 FUNCTION SQLGetDataSources() AS ARRAY
Request Example View Source

Return Value

Type: Array
An array of strings identifying the available ODBC data sources. If no sources are available, SQLGetDataSources() returns a NULL_ARRAY.
Remarks
Examples
The following example tests connection utility functions:
X#
 1FUNCTION TestConnect()
 2LOCAL wCount AS DWORD
 3LOCAL aSources AS ARRAY
 4LOCAL oConn AS SQLConnection
 5// Get an array of sources
 6aSources := SQLGetDataSources()
 7// List them
 8? "ODBC Sources..."
 9for wCount := 1 to ALen(aSources)
10? aSources[wCount]
11next
12// Connect to a list of sources
13oConn := SQLOpenConnection()
14// Make it the default connection
15SQLSetConnection(oConn)
16// Disconnect
17oConn:Disconnect()
See Also