Ms Access 简明教程

MS Access - Data Export

在本章中,我们将了解如何从 Access 中导出数据。数据导出实际上与数据导入相反。在数据导入中,我们将数据从其他格式导入 Access,而在导出中,我们会以其他格式保存数据。

In this chapter, we will understand how to export data from Access. Data export is actually the opposite of importing data. In importing data, we bring data from other formats in Access, while in exporting we save the data in other formats.

要了解你可以从 Access 数据中导出哪种数据,让我们打开你的数据库,进入外部数据选项卡。

To understand what kind of data you can export from Access data, let us open your database and go to the External Data tab.

export

在导出组中,你可以看到为从 Access 中导出数据而提供的不同类型的选项。以下是使用最广泛的数据导出格式−

In the Export group, you can see the different kind of options available for data export from Access. Following are the most commonly used data export formats −

  1. Microsoft Office Excel

  2. Microsoft Office Access

  3. ODBC Databases (For example, SQL Server)

  4. Text files (delimited or fixed-width)

  5. XML Files

Example

让我们来看一个从 Access 中导出数据的简单示例。打开你想从中导出数据的数据库。在导航窗格中,选择你想从中导出数据的对象。

Let us look at a simple example of data export from Access. Open your database where you want to export the data from. In the Navigation Pane, select the object that you want to export the data from.

export data

你可以从表、查询、窗体和报表对象等导出数据。让我们选择 qryAllProjects,然后进入外部数据选项卡。

You can export the data from table, query, form, and report objects etc. Let us select the qryAllProjects and then, go to the External Data tab.

在外部数据选项卡上,点击你想导出的数据类型。例如,要以可通过 Microsoft Excel 打开的格式导出数据,请点击 Excel。

On the External Data tab, click on the type of data that you want to export to. For example, to export data in a format that can be opened by Microsoft Excel, click Excel.

excel

访问启动导出向导。在向导中,您可以设置导出目标文件名和格式、是否包含格式设置和布局以及要导出的记录等信息。填写完所需的信息后,单击“确定”。

Access starts the Export wizard. In the wizard, you can set the information such as the destination file name and format, whether to include formatting and the layout, which records to export. Once you are done with the required information, click Ok.

export wizard

在此向导屏幕上,Access 通常会询问您是否要保存导出操作的详细信息。如果您认为将来需要反复执行相同的操作,则选中“ Save export steps ”复选框并关闭对话框。

On this screen of the Wizard, Access usually asks you if you want to save the details of the export operation. If you think you will need to perform the same operation on a recurring basis, select the Save export steps check box and close the dialog box.

随即打开以下 Excel 文件。

The following Excel file opens up.

save export

现在假设您想将数据导出到文本文件,请在“外部数据”选项卡中单击“文本文件”。

Let us now suppose you want to export data to a text file, on the External Data tab, click on the Text File.

text file

指定导出选项并单击“确定”。您将看到编码对话框,其中我们要使用默认编码导出数据。

Specify the export options and click Ok. You will see the Encode dialog box, wherein we want to export the data in default encoding.

windows default

选择第一个选项并单击“确定”。

Select the first option and click Ok.

first option

在此向导屏幕上,Access 通常会询问您是否要保存导出操作的详细信息。如果您认为将来需要反复执行相同的操作,则选中“ Save export steps ”复选框并关闭对话框。

On this screen of the wizard, Access usually asks you if you want to save the details of the export operation. If you think you will need to perform the same operation on a recurring basis, select the Save export steps check box and close the dialog box.

现在,您将看到打开文本文件。

You will now see that the Text file is open.

explore

同样,您还可以探索其他选项。因此强烈建议也熟悉其他导入导出功能。

Similarly, you can explore other options as well. Thus, it is highly recommended to play with other import export features too.