Communicating with SQL Server
DB-Library functions communicate with Microsoft® SQL Server™ 2000 through the DBPROCESS structure. The dbopen function allocates and initializes a DBPROCESS when it logs on to SQL Server. DBPROCESS serves as the connection between the application and SQL Server. Most DB-Library functions require DBPROCESS as the first parameter. An application can have more than one DBPROCESS if, for instance, it needs to update a database while still processing the results of an earlier query. Each DBPROCESS is completely independent of any other.
Another structure, LOGINREC, allocated by dblogin, is the login record that contains information the dbopen function uses to log on to SQL Server. It contains typical login information, such as the username and password. This information is also specified through DB-Library for C functions.
Note With the Microsoft Windows NT® 4.0, Microsoft Windows® 95 and Windows 98 operating systems, each connection is a separate execution thread that is spawned when the connection to SQL Server is established with dbopen and terminated when the connection is closed using dbclose.