Importing, Linking, and Opening Files: When and Why
When you import data into an Access table, Access makes a copy of the data and places it in the Access table. After it imports the data, Access treats it like any other native Access table. In fact, neither you nor Access has any way of knowing from where the data came. As a result, imported data offers the same performance and flexibility as any other Access table.Linking to external data is quite different from importing data. Linked data remains in its native format. By establishing a link to the external data, you can build queries, forms, and reports that present the data. After you create a link to external data, the link remains permanently established unless you explicitly remove it. The linked table appears in the database window just like any other Access table, except that its icon is different. In fact, if the data source permits multiuser access, the users of your application can modify the data, as can the users of the applications written in the data source's native database format (such as FoxPro, dBASE, or Paradox). The main difference between a linked and a native table is that you cannot modify the linked table's structure from within Access.Opening an external table is similar to linking to the table, except that a permanent relationship is not created. When you link to an external table, Access maintains connection information from session to session. When you open a table, you create a recordset from the table, and Access does not establish a permanent link to the data.
Selecting an Option
It is important that you understand when to import external data, when to link to external data, and when to open an external table directly. You should import external data in either of these circumstances:
- You are migrating an existing system into Access.
- You want to use external data to run a large volume of queries and reports, and you will not update the data. You want the added performance that native Access data provides.
When you are migrating an existing system to Access and you are ready to permanently migrate test or production data into your application, you import the tables into Access. You might also want to import external data if the data is downloaded from a mainframe into ASCII format on a regular basis, and you want to use the data for reports. Instead of attempting to link to the data and suffering the performance hits associated with such a link, you can import the data each time it is downloaded from the mainframe.You should link to external data in any of the following circumstances:
- The data is used by a legacy application requiring the native file format.
- The data resides on an ODBC-compliant database server.
- You will access the data on a regular basis (making it prohibitive to keep the data up-to-date if it is not linked).
Often, you won't have the time or resources to rewrite an application written in FoxPro, Paradox, or some other language. You might be developing additional applications that will share data with the legacy application, or you might want to use the strong querying and reporting capabilities of Access instead of developing queries and reports in the native environment.By linking to the external data, users of existing applications can continue to work with the applications and their data. Your Access applications can retrieve and modify data without concern for corrupting, or in any other way harming, the data.If the data resides in an ODBC database such as Microsoft SQL Server, you want to reap the data-retrieval benefits provided by a database server. By linking to the ODBC data source, you can take advantage of Access's ease of use as a front-end tool, while taking advantage of client/server technology.Finally, if you intend to access data on a regular basis, linking to the external table instead of temporarily opening the table directly provides you with ease of use and performance benefits. After you create the link, in most cases, Access treats the table just like any other Access table.You should open an external table directly in either of these circumstances:
- You rarely need to establish a connection to the external data source.
- You have determined that performance actually improves by opening the data source directly.
If you rarely need to access the external data, it might be appropriate to open it directly. Links increase the size of your MDB file. This size increase is not necessary if you rarely will access the data. Furthermore, in certain situations, when accessing Indexed Sequential Access Method (ISAM) data, you might find that opening the table directly provides better performance than linking to it.Although this chapter covers the process of importing external data, this is essentially a one-time process and doesn't require a lot of discussion. It is important to note, however, that after you import data into an Access table, it no longer is accessed by the application in its native format. The majority of this chapter focuses on linking to or directly opening external data tables.
Looking at Supported File Formats
Microsoft Access enables you to import, link to, and open files in these formats:
- Microsoft Jet databases (including previous versions of Jet)
- Access projects (ADP and ADE files)
- ODBC databases
- SharePoint Team Services
- Windows SharePoint Services
- HTML documents
- XML documents (import and open only)
- Microsoft Exchange/Outlook
- dBASE III, dBASE IV, and dBASE 5.0
- Paradox 3.x , 4.x , and 5.x
- Microsoft Excel spreadsheets, versions 3.0, 4.0, 5.0, and 8.0
- Lotus WKS, WK1, WK3, and WK4 spreadsheets (import and open only)
- ASCII text files stored in a tabular format