【正文】
ow to write an application to connect to a database and pass mands to the database. SQL Server provides native support for two main classes of database APIs, which in turn determine the data object interface that you can use. Use the database APIs to have more control over application behavior and performance.OLE DB This is a Component Object Model(COM)based data access interface. It supports application written using OLE DB or data object interface that use OLE DB. OLE DB can access data in SQL Server, other relational databases, and other data sources.Open Database Connectivity Open Database Connectivity(ODBC) is a calllevel interface. It directly access the SQL Server TDS protocol and supports applications or ponents that are written using ODBC or data object interface that use ODBC. ODBC can access data in SQL Server and other relational database, but generally it cannot be used to access other data sources. Data Object InterfacesIn general, data object interfaces are easier to use than database APIs but may not expose as much functionality as an API.ActiveX Data Objects Microsoft ActiveX Data Object(ADO) encapsulate the OLE DB API in a simplified object model that reduces application development and maintenance costs. ADO can be used from Microsoft Visual Basic, Visual basic for applications, Active Server Pages(ASP), and the Microsoft Internet Explorer scripting object model.Remote Data Object Remote Data Object(ROD) map over and encapsulate the ODBC API. RDO can be used from Visual Basic and Visual Basic for applications. WITH SQL SERVER Designing An Application For SQL ServerPlanning a database design requires knowledge of the business functions that you want to model and database concepts and features that you use to represent those business functions.Before you design an application for SQL Server, it is important to spend time designing a database to model the business accurately. A welldesigned database requires fewer changes and generally performance more efficiently. The architecture that you select affect how you develop, deploy and manage your software application. Software ArchitectureYou can use one of several application architecture to implement client/server applications. However, selecting a layered application approach affords flexibility and a choice of management options. You can divide software applications into three logical layers, which can physically reside on one or more servers. DesignTypical application deployment options include:Intelligent Server(2tier) Most processing occurs on the server, with presentation services handled on the client. In many instance, most of the business services logic is implemented in the database. This design is useful when clients do not have sufficient resources to process the business logic. However, the server can bee a bottleneck because database and business services pete for the same hardware resources.Corporate applications designed from a databasecentric point of view are an example of this design.Intelligent Client(2tier) Most processing occurs on the client, with presentation services handled on the server. This design is widely used. However, network traffic can be heavy and transactions longer, which can in turn affect performance.Applications developed for small organizations with product such as Micro