16.4.2 SQLDrivers, SQLDriversW
- Organization of this subsection
(1) Function
This ODBC function returns a listing of driver descriptions and driver attribute keywords.
This function is implemented by the driver manager. The HADB ODBC driver provides SQLDrivers or SQLDriversW as a function that always returns SQL_SUCCESS.
(2) Format
-
For SQLDrivers
SQLRETURN SQLDrivers ( SQLHENV EnvironmentHandle, /* In */ SQLUSMALLINT Direction, /* In */ SQLCHAR * DriverDescription, /* Out */ SQLSMALLINT BufferLength1, /* In */ SQLSMALLINT * DescriptionLengthPtr, /* Out */ SQLCHAR * DriverAttributes, /* Out */ SQLSMALLINT BufferLength2, /* In */ SQLSMALLINT * AttributesLengthPtr /* Out */ )
-
For SQLDriversW
SQLRETURN SQLDriversW ( SQLHENV EnvironmentHandle, /* In */ SQLUSMALLINT Direction, /* In */ SQLWCHAR * DriverDescription, /* Out */ SQLSMALLINT BufferLength1, /* In */ SQLSMALLINT * DescriptionLengthPtr, /* Out */ SQLWCHAR * DriverAttributes, /* Out */ SQLSMALLINT BufferLength2, /* In */ SQLSMALLINT * AttributesLengthPtr /* Out */ )
(3) Arguments
- EnvironmentHandle
-
Specifies an environment handle.
- Direction
-
Specifies how the driver manager is to read the data source information. The permitted values are as follows:
-
SQL_FETCH_FIRST: Fetch the driver description from the top of the list (both user and system DSNs).
-
SQL_FETCH_NEXT: Fetch the next driver description from the list.
-
- DriverDescription
-
Specifies a pointer to the buffer in which the driver description is to be returned.
- BufferLength1
-
Specifies the length# of the buffer in which the driver description is to be returned.
- DescriptionLengthPtr
-
Specifies a pointer to the buffer that stores the total valid length# of *DriverDescription. This length does not include the null terminating character.
- DriverAttributes
-
Specifies a pointer to the buffer that stores the driver attribute values.
- BufferLength2
-
Specifies the length# of the buffer in which the driver's attribute values are to be returned.
- AttributesLengthPtr
-
Specifies a pointer to the buffer that stores the total valid length# of *AttributesLengthPtr. This length does not include the null terminating character.
- #
-
The length must be in bytes for SQLDrivers and in characters for SQLDriversW.
(4) Return value
This ODBC function returns SQL_SUCCESS.
(5) SQLSTATE
This ODBC function returns one of the following SQLSTATE values:
SQLSTATE |
Description |
Remarks |
Returned |
---|---|---|---|
01000 |
General warning |
-- |
N |
01004 |
Character string data was right-truncated |
N |
|
HY000 |
General error |
N |
|
HY001 |
Memory allocation error |
N |
|
HY013 |
Memory management error |
N |
|
HY090 |
Invalid string or buffer length |
N |
|
HY103 |
Invalid retrieval code |
N |
- Legend:
-
N: This SQLSTATE is not returned by the HADB ODBC driver.
--: None