Matt Domo
Microsoft Corporation
August 1997
Click to open or copy the sample files associated with this technical article.
Many database application vendors find their products at a critical point in the product life cycle. They have released several versions using indexed sequential access method (ISAM) based database management systems (DBMS) like Btrieve with a solid level of success. However, due to rapidly expanding customer needs and the powerful product capabilities of today's DBMS offerings, many vendors are now converting their applications to different database platforms. Most of these vendors are converting applications to relational database management systems (RDBMS) to take advantage of the enhanced features and capabilities they provide. Applications based on an RDBMS offer better performance and are more versatile than ISAM-based solutions because they offer better scalability, can handle many more users, and are designed to handle databases that vary in size from a few megabytes to several hundred gigabytes.
Microsoft® SQL Server™ is one of the most powerful and flexible RDBMSs available. Its ease of use and advanced features make it an attractive solution for the database application developer. This paper presents a strategy that will enable you to convert Btrieve applications to access Microsoft SQL Server. The strategy presents many of the features of Microsoft SQL Server that make it a high performance alternative to any ISAM platform. While the Btrieve platform is the main focus of this paper, many of the concepts can be applied to any ISAM-based application.
For clarity and ease of presentation, the reference development and application platforms are assumed to be Microsoft Visual C++® and Microsoft Windows NT® or Microsoft Windows® 95. The Btrieve function and DLL references throughout this document reflect this assumption. However, these techniques can also be applied to other compilers that create Microsoft Windows applications.
Several tables from the Microsoft SQL Server pubs sample database are used in both the sample applications and sample code referenced in this paper. These tables were chosen because they are readily available to any SQL Server user and because their structure and entity relationships are presented in the SQL Server documentation.
The following sample applications and wrapper DLL are referenced and included with this paper.
Sample Btrieve application that references the Sales.btr and Titlepub.btr Btrieve data files. It is the starting point for the conversion strategy, and it is a simple data-entry and reporting application for a database that maintains information about publishing companies, the titles they manage, and current sales information for each title.
Sample wrapper DLL that translates the Btrieve calls in Btrvapp.exe to ODBC and Microsoft SQL Server Transact-SQL calls. The wrapper provides a bare minimum conversion from a Btrieve ISAM implementation to a Microsoft SQL Server client/server implementation. Using this wrapper DLL, Btrvapp.exe accesses unnormalized tables from the Microsoft SQL Server pubs database instead of the Btrieve data files.
Sample ODBC and SQL application that performs the same functionality as the Btrvapp.exe and Mybtrv32.dll combination by using ODBC and SQL only, and no Btrieve calls or references.
Script file that creates the unnormalized tables in the pubs database referenced by the wrapper DLL, as well as the stored procedures used by Odbcapp.exe for illustrative purposes.