The Error
When starting the Btr2SQL migration tool, you receive an message in the login dialog saying “Error loading driver!”.
The Cause
The “driver” for the migration tool is one of three dlls: sql_btr.dll, ora_btr.dll or mys_btr.dll found in the bin folder of the installation (usually \Mertech Data Systems\DB Drivers\Btrieve\bin). As noted in the user manual, each of these drivers depends on a client driver to be installed for the target server. For instance, the Microsoft SQL Native Client, Oracle Instant Client, or the MySQL libmysql.dll. There may also be other dependencies such as the C runtime libraries. If any of the dependencies are not found on the system’s PATH, Windows will fail to load the Mertech dll.
The Resolution
First and foremost, be sure the appropriate client connection driver is installed. If you still get the error, you must verify the correct dlls have been found and are able to load. Here are two techniques:
Using the Driver Trace
Click Cancel on the login dialog to allow the main migration tool to display (you may have to cancel one more login dialog). Choose File | Preferences from the menu to open the application settings screen. Enable the Runtime trace log to a location of your choice and set this for level 2. Close this dialog with the OK button and the choose File | Login to try your login once again. After you have clicked on the appropriate server choice and you see the Error Loading Driver message again, cancel the login dialog once more.
If Windows was able to load the Mertech driver, these steps should have created a log file of the failure. Check for the trace file that you specified earlier. If it exists, it will be small and should have more information about the cause of the failure.
If the trace file was not created, a dependency is missing and must be identified:
Using Dependency Walker
The best tool for this job is Dependency Walker which can be downloaded from www.dependencywalker.com Since the Mertech driver and migration application are 32-bit, you will want to install the 32-bit version of Dependency Walker. Open the ZIP file that is downloaded, create a folder somewhere on your system (perhaps \depends) and drag a shortcut to your desktop or quick launch toolbar.
Once you open Dependency Walker, choose File | Open from the menus and browse to the location of the driver dll. Again, this is usually installed at “C:\Program Files (x86)\Mertech Data Systems\DB Drivers\Btrieve\bin”. Choose SQL_BTR.dll for MS SQL, ORA_BTR.dll for Oracle or MYS_BTR.dll for MySQL.
Any dlls that are missing or do not match the needs will appear in yellow or red. These are the clues as to why the Mertech dll is not able to load. The most common dlls to be missing are libmysql.dll and oci.dll.
