Programming DB-Library for C
Microsoft® SQL Server™ is a powerful structured query language (SQL) database server. With local area network (LAN) software, SQL Server allows clients running the Microsoft Windows NT® 4.0, Microsoft Windows®, or Microsoft MS-DOS® operating systems to access its services. Developers can write applications for SQL Server by programming with DB-Library for C, the C-language version of the communication library for SQL Server.
Warning While the DB-Library API is still supported in Microsoft SQL Server 2000, no future versions of SQL Server will include the files needed to do programming work on applications that use this API. Connections from existing applications written using DB-Library will still be supported in the next version of SQL Server, but this support will also be dropped in a future release. When writing new applications, avoid using DB-Library. When modifying existing applications, you are strongly encouraged to remove dependencies on DB-Library. Instead of DB-Library, you can use Microsoft ActiveX® Data Objects (ADO), OLE DB, or ODBC to access data in SQL Server.
DB-Library for C is an application programming interface (API) consisting of C functions and macros that allow an application to interact with SQL Server. Included are functions that send Transact-SQL statements to SQL Server and functions that process the results of those statements. Other functions handle errors and convert data.
DB-Library for C offers a rich set of functions for:
- Opening connections.
- Formatting queries.
- Sending query batches to the server and retrieving the resulting data.
- Using scrollable cursors.
- Bulk-copying data from files or program variables to and from the server.
- Controlling two-phase commit operations between several participating SQL Servers.
- Executing stored procedures or remote stored procedures.
These functions allow the application developer extremely fine-grained control of data flow back and forth between the client and the server. DB-Library supports multiple environments. C programmers can choose from among:
- A multithread dynamic-link library (DLL) for the Windows NT 4.0 operating system.
- Medium and large model static-link libraries for MS-DOS for both Microsoft and Borland compilers.
- A DLL for the Windows operating system.