4D v14.1ODBC_SQLDataSources |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.1
ODBC_SQLDataSources
|
ODBC_SQLDataSources ( direction ; serverName ; description ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
direction | Longint |
![]() |
Which data source the Driver Manager returns information for | |||||
serverName | Text |
![]() |
Data source name | |||||
description | Text |
![]() |
Description of the driver associated with the data source | |||||
Function result | Longint |
![]() |
Returns the result of the MS ODBC API function SQLDataSources | |||||
The ODBC_SQLDataSources command returns information about the User and System data sources defined in the Driver Manager.
The direction parameter defines how to fetch the data sources and can be one of the following values:
Constant | Description |
SQL_FETCH_NEXT | Fetch the next data source name in the list |
SQL_FETCH_FIRST | Fetch from the beginning of the list |
SQL_FETCH_FIRST_USER | Fetch the first User data sources |
SQL_FETCH_FIRST_SYSTEM | Fetch the first System data sources |
serverName is the name of the data source, such as "MS Access Database."
description is the description of the driver associated with the data source, like "Microsoft Access Driver (*.mdb)."
For more information, please see the SQLDataSources function in the MS ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms711004(VS.85).aspx.
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.
The following method retrieves all the data sources and their descriptions and puts them into two arrays:
ARRAY TEXT(arServer;0)
ARRAY TEXT(arDescription;0)
$result:=ODBC_SQLDataSources(SQL_FETCH_FIRST;vServer;vDescription)
If($result=SQL_SUCCESS) `If it's successful, there might be other data sources
Repeat
APPEND TO ARRAY(arServer;vServer) `add server name to end of the array
APPEND TO ARRAY(arDescription;vDescription) `add description to end of the array
$result:=ODBC_SQLDataSources(SQL_FETCH_NEXT;vServer;vDescription)
Until($result=SQL_NO_DATA) `loop until no data is retrieved by the command
End if
Product: 4D
Theme: ODBC_Information
Number:
16992
Created: 4D ODBC Pro 2004
4D ODBC Pro ( 4D ODBC Pro v11.4)
4D ODBC Pro ( 4D ODBC Pro v12)
4D ODBC Pro ( 4D v13)
4D ODBC Pro ( 4D v14 R3)
4D ODBC Pro ( 4D v14.1)
4D ODBC Pro ( 4D v14 R2)
4D ODBC Pro ( 4D v14 R4)