Chapter 9 Developing Client/Server Applications

This chapter introduces you to the concepts of client/server development using the Microsoft Jet database engine. Microsoft Jet contains a number of features that enable you to create client/server applications with any application that can use the Data Access Objects (DAO) programming interface, such as Microsoft Access, Microsoft Visual Basic, or Microsoft Excel. Microsoft Jet is tightly integrated with the Open Database Connectivity (ODBC) standard, which enables access to the most popular and widely used SQL database servers. With DAO 3.5, you can also access ODBC data sources without loading Microsoft Jet by using an ODBCDirect Workspace object.

This chapter discusses the differences between using Microsoft Jet and ODBCDirect in client/server applications, and gives the advantages of each. It describes the ODBCDirect object model, and provides information on how to implement your client/server application using the objects, methods, and properties of both Microsoft Jet and ODBCDirect Workspace objects. The code examples in this chapter work with Microsoft SQL Server 6.5, and you can easily modify them to work with other ODBC databases.

Most of the other chapters in this guide assume you are already familiar with the basic concepts of database design. However, because client/server computing is a new concept to most developers, the first section of this chapter contains introductory material.

Introduction to Client/Server Design

Using DAO to Connect to ODBC Data Sources

Creating Client/Server Applications Using Microsoft Jet

The Object Model for ODBCDirect Workspaces

Using ODBCDirect

Managing Connection Resources

Using the Code Examples in This Chapter

You can use the code examples in this chapter to help you understand the concepts discussed, or you can modify them and use them in your own applications.

The code examples are located in the JetBook\Samples subfolder on the companion CD-ROM. The code examples for Microsoft Access 97 are in JetSamples.mdb, and the corresponding code examples for Microsoft Visual Basic version 5.0 and other applications that support Visual Basic for Applications are referenced in JetSamples.vbp. Both JetSamples.mdb and JetSamples.vbp use tables and queries in NorthwindTables.mdb, also located in the JetBook\Samples subfolder.

To use the code examples, copy the sample files to your hard disk. Be sure to copy NorthwindTables.mdb as well so that you can use the code examples to work with data.

Some of the examples shown in this chapter exist in the BookSales and BookSalesOptimized projects. These Visual Basic 5.0 projects are located in the JetBook\Samples\BookSales and JetBook\Samples\BookSalesOptimized subfolders. To use these applications, you must first perform the following steps:

  1. Create a data source name (DSN) that refers to the Pubs database on your own SQL Server.

  2. Change the conConnect constant to connect to your SQL Server. Include the name of the new DSN.

  3. Re-link the ODBC tables in JetBook\Samples\BookSalesOptimized \Pubs.mdb so that they point to the Pubs database on your SQL Server.

See Also For more information about copying and using the code examples from the companion CD-ROM, see “Using the Companion CD-ROM” in the Preface. For more information about the BookSales and BookSalesOptimized applications, see the Readme.doc file in the JetBook\Samples\BookSales subfolder.