INF: Using DB-Library with Borland C++
ID: Q104717
|
The information in this article applies to:
-
Microsoft SQL Server Programmer's Toolkit, version 4.2
SUMMARY
Using DB-Library for Microsoft Windows and MS-DOS with Borland C++
version 3.1 requires a few additional steps to configure correctly.
MORE INFORMATION
Follow these steps to create a Borland C++ project for a DB-Library
application:
- Select the Options menu, choose Directories. Include the directory
where the DB-Library .H header files are located
(C:\SQL\DBLIB\INCLUDE by default) in the Include Directories box.
Include the directory where the DB-Library .LIB library files are
located (C:\SQL\DBLIB\LIB by default) in the Library Directories box.
- Select the Project menu, choose Open Project. Pick an appropriate
project File Name, using the Directories list box to specify the
directory where the application's C/C++ source code files reside.
- Select the Options menu, choose Application. Pick the appropriate
application option button:
- For Windows, pick Windows App or Windows DLL
- For MS-DOS, pick DOS Standard
- Select the Project menu, choose Add Item. In the File Name box of the
Add To Project List dialog box, type the directory (C:\SQL\DBLIB\LIB
by default) and file name of the appropriate DB-Library .LIB library
file:
- For Windows, use W3DBLIB.LIB
- For medium model MS-DOS, use BMDBLIB.LIB
- For large model MS-DOS, use BLDBLIB.LIB
then use the Add button to include the file in the project. Ensure
that the appropriate .LIB file is now listed in the Project window.
- Include the C/C++ application's source code files in the project.
- For MS-DOS, select the Options menu, choose Compiler, then Code
Generation. From the Model list, choose the appropriate memory model:
- For medium model MS-DOS, pick Medium
- For large model MS-DOS, pick Large
- Select the Options menu, choose Compiler, then Advanced Code
Generation. Ensure that the Generate Underbars box is checked. If this
option is unchecked, Borland linker errors similar to the following
will occur:
Linker Error: Undefined symbol dbinit in module SQLTEST.C
- For Windows, select the Options menu, choose Linker, then Settings.
Ensure that both Case-Sensitive Link and Case-Sensitive Exports are
checked. If either of these options are unchecked, Borland linker
errors similar to the following will occur:
Linker Error: Undefined symbol _dbinit in module SQLTEST.C
- For Windows, select the Options menu, choose Compiler, then Entry/Exit
Code. NOTE: Windows all functions exportable is the default. If
either Windows explicit functions exported or Windows DLL explicit
functions exported is chosen, the application's DB-Library error and
message handlers must be declared using the Borland C++ __export
keyword. Failure to do can result in a general protection fault (GP fault)
inside the application's DB-Library error or message handler.
Additional query words:
dblib
Keywords : kbprg SSrvDB_Lib SSrvProg
Version : 4.2
Platform : MS-DOS
Issue type :
|