Mertech Blog

How do I know if I am using the Pervasive or Mertech Btrieve dll?

Written by Mertech | Jan 21, 2016 6:10:00 PM

As one of the last steps in the migration process, you substitute the Pervasive Btrieve runtime dll (wbtrv32.dll or later version called w3btrv7.dll) with the Mertech runtime dll of the same name. The Mertech runtime dll codes the standard Btrieve operations so that they will work with the new SQL backend.

Note: A copy of the Pervasive dll is saved because many of the Pervasive tools require it.

Typically the Mertech version of the dll is placed in the directory with the application executable. If the dll is not placed in the directory with the application, it must be placed somewhere it can be found using the standard Windows dll search:

    1. The current directory.
    2. The Windows system directory (GetSystemDirectory).
    3. The Windows directory (GetWindowsDirectory).
    4. The directories listed in the PATH environment variable.

You may want to know whether the Pervasive or Mertech version of the dll was loaded with your application. Or, perhaps you want to know which version of the Mertech driver was loaded, or what version of the SQL server is currently connected. The BTR2SQL SDK includes a function B_EXTENDED_VERSION that can do all of this. This function is used just like any other BTRCALL. Below is C++ code that shows how to use B_EXTENDED_VERSION:

MDS_VERSIONINFO mdsVersionInfo;


status = BTRCALL(B_EXTENDED_VERSION, NULL, &mdsVersionInfo, &(dataLen=sizeof(mdsVersionInfo)), NULL, 0, MDS_VERSION_OF_DRIVER);

// If the Pervasive dll is loaded, INVALID_FUNCTION (1) is returned
if (status == B_NO_ERROR)
cout << "Mertech driver version for " << mdsVersionInfo.originalDllName << ": " << mdsVersionInfo.versionString << endl;
else
cerr << "Status " << status << " returned from B_EXTENDED_VERSION" << endl;


For additional information on the BTR2SQL SDK see the BTR2SQL User's Guide or the blog article titled The BTR2SQL SDK