Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export Objects in MSAccess Application to Text Objects, and Import Into A New MDB

Tags:

ms-access

I need to export all of the objects from my MDB to text files in a folder, and them import those text files as fresh Access objects into a brand new MDB, using some VBA code.

Does anyone have the source code for this? I know it exists out there somewhere, I just can't find it at the moment.

like image 483
Robert Harvey Avatar asked Jan 18 '10 20:01

Robert Harvey


People also ask

Can objects in Access be exported to a text file?

In the Access Navigation Pane, right-click the source object, point to Export, and then click Text File. You can also launch the Export - Text File wizard by highlighting the source object in the Navigation Pane and then on the External Data tab, in the Export group, click Text File.

What are the steps to export data from MS Access to another application?

To export data from Access, first select the table or other database object to export in the Navigation Pane. Next, click the “External Data” tab in the Ribbon. In the “Export” button group, then click the button for the file format to which to export the selected object.

What is import and export in MS Access?

In importing data, we bring data from other formats in Access, while in exporting we save the data in other formats. To understand what kind of data you can export from Access data, let us open your database and go to the External Data tab.


1 Answers

Corrupt Objects within a Corrupt Microsoft Access MDB

The little documented SaveAsText and LoadFromText may help if an object is corrupted or otherwise behaving weirdly.

At the debug/immediate window type:

Application.SaveAsText acForm,"MyForm","c:\form.txt"

You can load the file into a new MDB.

Application.LoadFromText acForm,"MyForm","c:\from.txt"

Sample code at http://www.datastrat.com/Code/DocDatabase.txt for saving all objects in an MDB.

like image 104
Tony Toews Avatar answered Nov 15 '22 07:11

Tony Toews