Access's Query Properties window includes two properties that let you create a query based on tables contained in a database other than the current database. The database that you open after you launch Access is called the current database. Databases other than the current database commonly are called external databases. The use of these two properties is as follows:
C:\Program Files\Seua10\Oakmont\Oakmont.mdb You must have installed the sample files from the CD-ROM in the default C:\Program Files\Seua11 folder for this connection string to work.
Running a query against an external database is related to running a query against linked tables. When you link tables, the data in the tables is available at any time that your application is running. When you run a query against an external database, the connection to the external database is open only while your query is open in Design or Datasheet view. A slight performance penalty exists for running queries against an external database each time that you run the query, Jet must make a connection to open the database. The connection is closed when you close the query. After you specify the external database, its tables appear in the Show Table dialog's list. Figure 11.77 illustrates a query design based on tables in the external Oakmont.mdb sample database. Figure 11.78 shows the result of executing the query design of Figure 11.77. Figure 11.77. Design view of a query in an external Jet database is the same as for a query against tables in the current database. You can create joins between external and current database tables, but you can't enforce referential integrity.
Figure 11.78. This datasheet displays the result set of the query of Figure 11.77 against the external Oakmont.mdb database.
Note
|