Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 2.02 KB

SQLDataSources.md

File metadata and controls

83 lines (63 loc) · 2.02 KB

Home

Function name : SQLDataSources

Group: ODBC API - Library: odbc32


SQLDataSources returns information about a data source. This function is implemented solely by the Driver Manager.


Code examples:

Enumerating ODBC Data Sources available on the local computer

Declaration:

SQLRETURN SQLDataSources(
     SQLHENV     EnvironmentHandle,
     SQLUSMALLINT     Direction,
     SQLCHAR *     ServerName,
     SQLSMALLINT     BufferLength1,
     SQLSMALLINT *     NameLength1Ptr,
     SQLCHAR *     Description,
     SQLSMALLINT     BufferLength2,
     SQLSMALLINT *     NameLength2Ptr);  

FoxPro declaration:

DECLARE SHORT SQLDataSources IN odbc32;
	INTEGER   EnvironmentHandle,;
	INTEGER   Direction,;
	STRING  @ ServerName,;
	INTEGER   BufferLength1,;
	INTEGER @ NameLength1Ptr,;
	STRING  @ Description,;
	INTEGER   BufferLength2,;
	INTEGER @ NameLength2Ptr  

Parameters:

EnvironmentHandle [Input] Environment handle.

Direction [Input] Determines which data source the Driver Manager returns information on.

ServerName [Output] Pointer to a buffer in which to return the data source name.

BufferLength1 [Input] Length of the *ServerName buffer, in bytes.

NameLength1Ptr [Output] Pointer to a buffer in which to return the total number of bytes (excluding the null-termination byte) available to return in *ServerName.

Description [Output] Pointer to a buffer in which to return the description of the driver associated with the data source.

BufferLength2 [Input] Length of the *Description buffer.

NameLength2Ptr [Output] Pointer to a buffer in which to return the total number of bytes (excluding the null-termination byte) available to return in *Description.


Return value:

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.