Help Center

CODBCBase.GetDriversmethod

Lists driver descriptions and driver attribute keywords.

DatabasesmethodCODBC.incdocumented

Syntax

FUNCTION GetDrivers (BYVAL Direction AS SQLUSMALLINT, BYREF dwsDriverDesc AS DWSTRING, BYREF dwsDriverAttributes AS DWSTRING) AS SQLRETURN

Parameters

NameDescription
DirectionDetermines whether the Driver Manager fetches the next driver description in the list (SQL_FETCH_NEXT) or whether the search starts from the beginning of the list (SQL_FETCH_FIRST).
dwsDriverDescA DWSTRING variable in which to return the driver description.
dwsDriverAttributesA DWSTRING variable in which to return the list of driver attribute value pairs (see "Comments").

Return value

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.

Description

Lists driver descriptions and driver attribute keywords. This function is implemented only by the Driver Manager.

Example

#include once "AfxNova/COdbc.inc" USING AfxNova

' // Create a connection object and connect with the database ' // We need to call it to create the environment handle DIM wszConStr AS WSTRING * 260 = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=biblio.mdb" DIM pDbc AS CODBC = wszConStr IF pDbc.Handle = NULL THEN PRINT "Unable to create the connection handle" : SLEEP : END

DIM wDirection AS WORD DIM dwsDriverAttributes AS DWSTRING DIM dwsDriverDesc AS DWSTRING

wDirection = SQL_FETCH_FIRST DO dwsDriverDesc = "" cwsDriverAttributes = "" IF SQL_SUCCEEDED(pDbc.GetDrivers(wDirection, dwsDriverDesc, dwsDriverAttributes)) = 0 THEN EXIT DO ? "Driver description: " & dwsDriverDesc ? "Driver attributes: " & dwsDriverAttributes wDirection = SQL_FETCH_NEXT LOOP

Reference

  • Include file CODBC.inc
  • Defined in AfxNova/COdbc.inc:243
  • Documented in Databases/ODBC Classes/CODBC Class.md
  • Topic: ODBC Classes