This section explains how to use Microsoft Access, Microsoft Excel, and the ODBCTest tool to test your custom ODBC driver.
Running your driver against Microsoft Access is a good test to prove basic functionality. Microsoft Access uses much of the ODBC API, including many of it's edge cases.
Note:
To get the widest test coverage of the ODBC API, test your driver under Microsoft Access by loading your data as linked tables.
To Test Your Custom ODBC Driver with Microsoft Access:
The data from the table appears in Microsoft Access.
You can test your data source with Microsoft Excel by importing data using the Data Connection Wizard.
To Test Your Custom ODBC Driver with Microsoft Excel:
The data from the table appears in your Excel workbook.
ODBCTest is a test application provided by Microsoft as part of the Microsoft Data Access Components (MDAC) SDK and the Platform SDK. For more information about MDAC, see What is MDAC?.
This application allows you to manually execute any SQL query. You can also use it to directly call any method in the ODBC API. The full ODBC API is exposed through the ODBCTest menus, allowing you to walk through each step of an ODBC API call and viewing the results in real time.
The MDAC installation includes both ANSI and Unicode-enabled versions of ODBC Test, for both 32-bit and 64-bit systems. The versions are clearly marked in the Programs menu:
Note:
Running your driver under the debugger with ODBCTest configured as the launch application is an excellent way to test. You can set breakpoints in your DSII, and break into them as various ODBC calls trigger corresponding DSII calls. You can break at every DSII API call, and step through the execution of each of your DSII methods to track down problems with precision.
For more information on using Visual Studio to debug into your custom ODBC driver with ODBCTest, see the section Debug the Custom ODBC Driver in the 5 Day Guides at http://www.simba.com/resources/sdk/documentation/.
To Test Your Custom ODBC Driver with ODBCTest:
Before running this test, ensure you have already configured a DSN for your driver. For more information on creating a DSN in the Windows registry for your custom ODBC driver, see Update the Windows Registry in the 5 Day Guides at http://www.simba.com/resources/sdk/documentation/.
This option allocates the environment and connection handles, then opens the connection.
Note:
If you see the error “SQLDriverConnect returned: SQL_ERROR=-1”, use the following tips for troubleshooting. This error usually occurs because the Windows Driver Manager cannot find or load the requested driver’s DLL. Check the following:
SQL Catalog functions work only if you have implemented the appropriate MetadataSources.
Debug the Custom ODBC Driver in the 5 Day Guides at http://www.simba.com/resources/sdk/documentation/
Update the Windows Registry in the 5 Day Guides at http://www.simba.com/resources/sdk/documentation/