Please enable JavaScript to view this site.

ESL Documentation

Level 2 subroutine

Determine all available data sources.

call EDSDataSources(HENV_IV, MAXROWS_IV, NUMROWS_IV, ARRAY_STRUCT ) 

HENV_IV An input integer value that indicates the environment handle.

MAXROWS_IV An input integer value that indicates the maximum number of rows in the result array.

NUMROWS_IV An output integer value that indicates the actual number of rows in the result array.

ARRAY_STRUCT An output array of EDSDATABASE_STRUCT structures that contain DBname, the data source name, and DBdescription, a description of the data source.

Description

EDSDataSources uses the ODBC Driver Manager to read and enumerate the data source names from the Windows Registry.

The driver determines how data source names are mapped to actual data sources. The list of data source names and their corresponding drivers are maintained in the Windows Registry. EDSDataSources places the names and descriptions of all data sources in an array of EDSDATABASE_STRUCT structures.

Return Values

EDSDataSources returns EDS_SUCCESS, EDS_SUCCESS_WITH_INFO, EDS_NO_DATA_FOUND, EDS_INVALID_HANDLE, or EDS_ERROR.

When EDSDataSources returns EDS_ERROR, you can obtain an associated SQLSTATE value with more specific information by calling EDSError. The following table lists each typical SQLSTATE value and explains each one in the context of the command EDSDataSources.

The following table lists possible SQLSTATE values.

 

SQL

STATE

Error

Description

01004

Data truncated

A character string was truncated. Function returns EDS_SUCCESS_WITH_INFO.

S1000

General error

An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by EDSError in the argument ERRORTEXT describes the error and its cause.

S1001

Memory

The Driver Manager was unable to allocate allocation failure memory required to support execution or completion of the function.

See Also

EDSBrowseConnect discovers and enumerates values required to connect to a data source.
EDSConnect establishes a connection with a data source.
EDSDriverConnect uses a connection string or a dialog box to connect with a data source.