Skip to content

Commit bc91682

Browse files
committed
Update export-all-data.md
1 parent 760e2d0 commit bc91682

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

docs/access/desktop-database-reference/export-all-data.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ ms.localizationpriority: medium
88

99
# Export all data from a Microsoft Access database
1010

11-
**Applies to**: Access 2024, Access 2021
11+
**Applies to**: Access 2024, Access 2021
1212

1313
This topic explains how an IT administrator can export all data and objects from a Microsoft Access database to text files, enabling use with other tools and supporting data portability.
1414

1515
For data stored in Tables, data can be exported to a variety of other formats using Access Wizards, such as Excel, see [Export data to Excel](https://support.microsoft.com/office/export-data-to-excel-64e974e6-ae43-4301-a53e-20463655b1a9), or text, see [Export data to a text file](https://support.microsoft.com/office/export-data-to-a-text-file-f72dfc38-a8a0-4c5b-8c2c-bf2950814140).
1616

17-
The following instructions demonstrate how to export objects using VBA code, using the [DoCmd.TransferText method](https://learn.microsoft.com/office/vba/api/Access.DoCmd.TransferText) command to export table data, and the [Application.SaveAsText](/application-save-as-text) command for other objects.
17+
The following instructions demonstrate how to export objects using VBA code, using the [DoCmd.TransferText method](/office/vba/api/Access.DoCmd.TransferText) command to export table data, and the [Application.SaveAsText](application-save-as-text.md) command for other objects.
1818

1919
The code provided will create a function that can be called with the full path to a database and a destination folder. It will then create a text file for each object in the database, which will contain the data from tables, and the definitions of all user created objects such as forms or reports.
2020

2121
Since this process uses OLE automation, the code could also be written using PowerShell or using a .NET language such as C#. For this example, we use VBA.
2222

23-
1. Create a new database.
24-
2. Create a new module.
25-
3. Copy and paste the following export database code into the module.
26-
4. For each database that you wish to export, enter the following command in the immediate window:<br>ExportAccessDatabase "_Full path to database_", "*Folder to contain exported objects*".
27-
a. Note that a new folder will be created in the target folder with the name of the exported database. This is to allow exporting multiple databases to the same target folder while keeping the contents of each exported database in a separate folder.
28-
b. If the database to be exported contains a startup form, or an AutoExec macro, startup actions may interfere with the export process, so you should reset the Startup Form property for the database, and remove or rename the AutoExec macro before attempting to call ExportAccessDatabase.
29-
5. If you wish to further automate this process, you could write a function that, given the path to a folder, enumerates all the databases in the folder, and calls teh ExportAccessDatabase function to export each Microsoft Access database to a target folder.
23+
1. Create a new database.
24+
1. Create a new module.
25+
1. Copy and paste the following export database code into the module.
26+
1. For each database that you wish to export, enter the following command in the immediate window:<br>ExportAccessDatabase "_Full path to database_", "_Folder to contain exported objects_".
27+
1. Note that a new folder will be created in the target folder with the name of the exported database. This is to allow exporting multiple databases to the same target folder while keeping the contents of each exported database in a separate folder.
28+
1. If the database to be exported contains a startup form, or an AutoExec macro, startup actions may interfere with the export process, so you should reset the Startup Form property for the database, and remove or rename the AutoExec macro before attempting to call ExportAccessDatabase.
29+
1. If you wish to further automate this process, you could write a function that, given the path to a folder, enumerates all the databases in the folder, and calls teh ExportAccessDatabase function to export each Microsoft Access database to a target folder.
3030

3131
## Export database code (VBA)
3232

0 commit comments

Comments
 (0)