HOW TO: Using DB-LIBRARY in a Threaded Application
Article ID: 151607
Article Last Modified on 2/14/2005
APPLIES TO
- Microsoft SQL Server 6.0 Standard Edition
- Microsoft SQL Server 2000 Standard Edition
This article was previously published under Q151607
SUMMARY
This article provides tips for using DB-LIBRARY in a
threaded application.
back to the top
Tips for Using DB-LIBRARY in a Threaded Application
When you are creating a DB-LIBRARY threaded application:
- Only call the dbinit and dbexit functions one time on your application.
- Use per-process error and message handling. For additional
information, see dbprocerrhandle and dbprocmsghandle.
If you use global error and message handlers, you may
have to synchronize access in your error and message handler
routines.
- Call dbsetmaxprocs if you are going to have more than 25 connections open
simultaneously.
- Make sure to perform compiling and linking by using the
multi-threaded C or C++ run-time libraries. By default, a Microsoft Visual C or
a Microsoft Visual C++ project is linked with the single-threaded run-time
libraries.
- If you use the same LOGINREC to open multiple connections,
you must serialize access to LOGINREC.
Note The DB-LIBRARY programming model is not supported
in SQL Server 2000 64 bit, and it has not been ported to the 64-bit version of Microsoft Windows.
back to the top
Keywords: kbhowto kbhowtomaster KB151607