Exporting and Importing Data

Sooner or later—probably sooner—you'll want to transfer information stored in an Access database to some other software environment, or move data originally created in another program into Access. In some cases, you'll want to move entire tables between database programs for use in different applications. For example, you might want to copy a table of supplier names and addresses from Access so that another database developer can incorporate that data into an application created with SQL Server or Oracle. Or, if you're building an Access database to replace an application created in an older program, such as dBASE, FoxPro, or Paradox, you might need to import data twice—once when you begin designing the database, so you can test forms, reports, and queries using real data, and a second time when you're ready to switch from the old system to the new one.

Even when you're extremely careful, exporting and importing information between database formats runs a serious risk of creating duplicate data sets. If you keep information about customers and products in Access and in an SQL Server database, for example, whoever is responsible for data entry has to enter changes in two places, and it's almost certain that some records will be out of sync or contain errors and inconsistencies. When you must use the same data in two different database programs, you should choose one program to store the data, and then create a link to that data from the other database program so that you can add or edit records or run queries. Because Access can link to data stored in a variety of formats—including dBASE, SQL Server, and Paradox—you will most often want to store shared data in another program and create links to it from Access.

In other cases, your need for Access data is strictly temporary. For instance, if you've created a report or query in Access, you can transfer the data to Word to incorporate it into a larger report, or send it to Excel, where you can easily analyze it with the help of PivotTables and charts.

The simplest and most efficient tools in this category are known as OfficeLinks; these shortcuts are designed to send Access data directly to another Office application. To use one of the three OfficeLink options, first select a target object in the current database window, or open a form, report, or query; then choose Tools, Office Links, or click the OfficeLinks drop-down list on the Access toolbar. The list includes the following three items:

  • Merge It with MS Word— This option sends a table of data to a new or existing mail-merge document in Word. When the transfer is complete, you can insert fields from the Access table as merge fields in the Word document itself.

  • Publish It with MS Word— This option creates a text file on disk—in RTF format—from a selected Access object, and immediately opens the file in Microsoft Word. This file might become the starting point for a longer business document or report.

  • Analyze It with MS Excel— This option creates a worksheet file on disk (in XLS format) from a selected Access object, and immediately opens the file in Excel. In the worksheet environment, you can perform mathematical, statistical, and other analytical operations that might not be possible in Access. You can also make use of Excel's versatile charting capabilities. If the report you start with includes grouping, the resulting Excel worksheet will include subtotals as well.

You can also create a Word or Excel file by selecting an object in the database window and then choosing File, Export. In the resulting Export dialog box, you can choose a specific format (including formats for previous versions of Office), and you can supply a nondefault name for the file that will be created. You might prefer this approach to the OfficeLink options if you need more control over the format or the name of the resulting file.

Tip from

If you're tempted to try the Publish It with MS Word button from an Access report, keep your expectations low. In general, the formatting in the exported file will only approximate the report formatting, and you'll have to do significant editing to get satisfactory results. It's often easier and more productive to use the Clipboard.


Another important use for Export and Import options is to exchange data between Access and other database-management programs. Access can produce files that can be read by a number of popular database applications, including most versions of dBASE, Paradox, and Lotus 1-2-3. To create a file in one of these formats, first open or select a database object, and then choose File, Export. To read files produced by these and other applications, choose File, Get External Data, Import.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.71.146