Client Development Interfaces

SQL Server provides several interfaces that support client application development—ODBC, Remote Data Objects (RDO), OLE DB, ActiveX Data Objects (ADO), and the legacy interfaces DB-Library and Embedded SQL for C (ESQL/C). The book's companion CD includes a whitepaper titled "Designing Efficient Applications for SQL Server" that compares all the interfaces described in this section—and a few more besides.

ODBC

ODBC is an API for database access that's both a formal and a de facto industry standard. Besides being one of the most popular database interfaces used by applications today, ODBC has gained status as the formal call-level interface standard by American National Standards Institute (ANSI) and International Organization for Standardization (ISO). SQL Server provides a high-performance ODBC interface for all Windows-based programming environments, and it can be distributed royalty-free with any application. The SQL Server ODBC driver implements every function in the ODBC 3 specification. In ODBC-speak, this makes it fully Level 2 (the highest level) conformant.

RDO is an object interface that's closely tied to ODBC, which means that it exposes all the functionality in the ODBC driver and is easily available to Visual Basic programs. RDO supports building visual controls tied directly to SQL Server data, which greatly reduces the amount of code that must be written to display data on the screen.

OLE DB

OLE DB was first released by Microsoft in 1996 to provide a COM interface to any tabular data source (that is, data that can be represented with rows and columns). This includes data in spreadsheets and even text files. OLE DB can be considered an object version of ODBC but is more powerful in that it can access data from data sources beyond those that ODBC can access. Unlike other object interfaces to SQL Server such as RDO, OLE DB doesn't make programming a call-level interface like ODBC any easier. Also, because OLE DB uses pointer data types extensively, it's only accessible from C and C++.

ADO

ADO is a higher-level object interface on top of OLE DB that provides much of the same functionality and performance. Because ADO is pointerless, it can be accessed from scripting languages such as JScript and development software such as Visual Basic, as well as from C and C++.

ADO is the recommended and supported interface for Internet applications written using the Microsoft Visual InterDev development tool. Applications written with Visual InterDev can call ADO from Active Server Pages (ASP) and incorporate code written in VBScript or JScript.

DB-Library

DB-Library is a SQL Server-specific API that provides all the necessary macros and functions for an application to open connections, format queries, send them to the server, and process the results. You can write custom DB-Library applications using C, C++, or Visual Basic (or any programming language capable of calling a C function).

DB-Library is the original SQL Server programming interface. Libraries are provided for MS-DOS, Windows 3.1, Windows 98, and Windows NT/2000. Developers are granted licensed rights to redistribute the DB-Library runtimes royalty-free. Although DB-Library continues to be officially supported for SQL Server 2000, it's not guaranteed to support the full-feature set.

ESQL/C

SQL Server provides an ESQL/C precompiler that allows developers to write SQL Server applications by embedding the SQL queries directly in their C source code. Many minicomputer and mainframe developers are already accustomed to this style of programming, and ESQL/C might be a natural choice for that reason. In addition, Microsoft has licensed some of the ESQL/C run-time environment to MERANT Micro Focus, the leading provider of COBOL compilers and tools. MERANT Micro Focus offers an embedded SQL interface for SQL Server directly in its COBOL development environment.

Server Development Interface

SQL Server offers an open API for developing server-based applications that work in conjunction with SQL Server. ODS is an event-driven API that is primarily used for developing extended stored procedures. ODS is actually a core part of the SQL Server architecture and benefits from the high-performance architecture. It provides all the network, connection, and thread management that SQL Server uses.

Formerly, ODS was frequently used to develop custom database gateways, data-driven event alerters, external program triggers, and request auditing in addition to extended stored procedure DLLs. However, with the advent of SQL Server distributed queries and newer technologies such as Windows Component Services, the need for ODS in developing applications of this type of gateway has largely been eliminated. I strongly recommend that you investigate other methods of developing the types of applications just mentioned and use ODS only for developing extended stored procedures.



Inside Microsoft SQL Server 2000
Inside Microsoft SQL Server 2000
ISBN: 0735609985
EAN: 2147483647
Year: 2005
Pages: 179
Authors: Kalen Delaney

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net