ODBC Test Overview
Microsoft ODBC Test is an ODBC-enabled application that you can use to test ODBC drivers. ODBC Test has four distinct types of menu items that you can use to execute ODBC functions:
-
Functions are menu items that call ODBC functions. When you select a function from an ODBC Test menu, ODBC Test displays a dialog box that has one control for each argument in the function. When you click OK in the dialog box, ODBC Test executes the function using the values specified for each argument.
If the ODBC Menu Version control in the User Options dialog box is set to 3.0, the ODBC Test menus include ODBC 3.0 functions. If the version is set to 2.x, the menus include ODBC 2.x functions. If the version control is set to Both 2.x and 3.0, the menus include both ODBC 2.x and ODBC 3.0 functions.
-
Function Tools are menu items that call a group of related ODBC functions or help you use an ODBC function. For example, Full Disconnect calls SQLDisconnect, SQLFreeHandle with a HandleType of SQL_HANDLE_DBC, and SQLFreeHandle with a HandleType of SQL_HANDLE_ENV; Fill Param displays a dialog box in which you enter parameter values. Function tools are listed at the bottom of the Diag, Env, Conn, Desc, Stmt, and Results menus beneath a separator line.
If the ODBC Menu Version control in the User Options dialog box is set to 3.0 or Both, the Function Tools use ODBC 3.0 functions. If the version is set to 2.x, the Function Tools use ODBC 2.x functions.
-
Tools are menu items that help you configure ODBC Test, such as the level of errors to report or whether menu items for functions the driver does not support are disabled.
-
Auto Tests, or automated tests, are dynamic-link libraries (DLLs) that you have written. Each auto test DLL contains one or more test cases. For example, an auto test for SQLAllocHandle might contain test cases to call SQLAllocHandle with valid and invalid arguments and to call SQLAllocHandle with a HandleType of SQL_HANDLE_STMT until the driver runs out of statement handles. The source code for a sample auto test that tests basic driver functionality (the Quick Test) is shipped with ODBC in the \Samples\Odbc\Quicktest directory.
The ODBC Test shipped with ODBC 3.51 contains both ANSI and Unicode-enabled versions. The corresponding files are:
-
ODBCTE32.EXE and GTRTST32.DLL, for the ANSI version.
-
ODBCT32W.EXE and GTRTS32W.DLL, for the Unicode version.
These files are installed in the \Bin\Odbc directory. At startup, each version reads from and writes to a different initialization file. The ANSI version uses the file GATOR32.INI, while the Unicode version uses the file GATOR32W.INI. There is a known limitation to both versions. The Unicode version does not support binding to the following data types:
-
SQL_C_CHAR
-
SQL_C_VARCHAR
-
SQL_C_LONGVARCHAR
The ANSI version does not support binding to the following data types:
-
SQL_C_WCHAR
-
SQL_C_WVARCHAR
-
SQL_C_WLONGVARCHAR
In order to use ODBC Test, you must understand the ODBC API, the C language, and SQL. For more information about the ODBC API, see the Microsoft ODBC Programmer's Reference.