cObject
---Array
------cCLIHandler
---------cODBCHandler
The cODBCHandler class implements functionality specific to Open Database Connectivity (ODBC).
Two methods are available to enumerate data sources. They can be used to present lists of available data sources in utilities. A procedure to show all available data sources with driver identification looks like:
Use ODBC_DRV.pkg Procedure ShowODBCDataSources Integer iDataSourceType Handle hoODBCHandler String sDataSourceAndDriver Get Create U_cODBCHandler To hoODBCHandler If (hoODBCHandler > 0) Begin Set DataSourceType Of hooDBCHandler To iDataSourceType Repeat Get DataSources Of hoODBCHandler To sDataSourceAndDriver Showln sDataSourceAndDriver Until (sDataSourceAndDriver = "") Send Destroy Of hoODBCHandler End End_Procedure // ShowODBCDataSources Showln "All datasources:" Send ShowODBCDataSources SQL_FETCH_ALL Showln Showln "All USER datasources:" Send ShowODBCDataSources SQL_FETCH_USER Showln Showln "All SYSTEM datasources:" Send ShowODBCDataSources SQL_FETCH_SYSTEM