4D v16.3GET DATA SOURCE LIST |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
GET DATA SOURCE LIST
GET DATA SOURCE LIST
The GET DATA SOURCE LIST command returns, in the sourceNamesArr and driversArr arrays, the names and drivers of the sourceType type data sources defined in the ODBC manager of the operating system. 4D allows you to connect to an external ODBC data source directly via the language and execute SQL queries within a Begin SQL/End SQL tag structure. This works as follows: the GET DATA SOURCE LIST command can be used to get a list of data sources present on the machine. The SQL LOGIN command can then be used to designate the source to be used. You can then execute SQL queries using a Begin SQL/End SQL tag structure in the “current” source. To carry out queries using the 4D internal engine again, simply pass the SQL LOGOUT command. For more information about SQL commands in the Method editor, please refer to the 4D SQL Reference manual. In sourceType, pass the type of data source that you want to retrieve. You can use one of the following constants, found in the “SQL” theme:
Note: This command does not take file type data sources into account. The command fills and sizes the sourceNamesArr and driversArr arrays with the corresponding values. Note: If you want to connect to an external 4D data source via ODBC, you will need to have installed the 4D ODBC Driver on your machine. For more information, please refer to the 4D ODBC Driver Installation manual. Example using a user data source:
ARRAY TEXT(arrDSN;0) If the command is executed correctly, the OK system variable is set to 1. Otherwise, it is set to 0 and an error is generated.
See also
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v11 SQL ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||