Microsoft KB Archive/104717

From BetaArchive Wiki

INF: Using DB-Library with Borland C++

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:


  1. 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.
  2. 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.
  3. Select the Options menu, choose Application. Pick the appropriate application option button:

    1. For Windows, pick Windows App or Windows DLL
    2. For MS-DOS, pick DOS Standard
  4. 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:

    1. For Windows, use W3DBLIB.LIB
    2. For medium model MS-DOS, use BMDBLIB.LIB
    3. 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.
  5. Include the C/C++ application's source code files in the project.
  6. For MS-DOS, select the Options menu, choose Compiler, then Code Generation. From the Model list, choose the appropriate memory model:

    1. For medium model MS-DOS, pick Medium
    2. For large model MS-DOS, pick Large
  7. 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
  8. 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
  9. 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 : kbprogramming
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbSQLServPTK420


Last Reviewed: March 18, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.