I have an Access database with over 200 files. I'd like to export all
of them to csv files.
Databases don't contain "files" - but tables. Are all these tables of the same
structure?? How did you get in this mess, in other words?
The Export function only handles one table at a time.
Any reasonably easy way I can export all of them?
Write VBA code and use the TransferText method to export them. You can loop
through the Tabledefs collection:
Public Sub ExportAll()
Dim tdf As DAO.Tabledef
Dim db As DAO.Database
Set db = CurrentDb
For Each tdf In db.Tabledefs
If Left(tdf.Name, 4) <> "MSys" Then ' exclude system tables
DoCmd.TransferText acExportDelim, , tdf.Name, _
"E:/SomePath/" & tdf.Name & ".txt"
Next tdf
End Sub
will export all non-system tables to the folder SomePath on drive E, with the
filename being the tablename with a .txt extension. See the online help for
TransferText for (quite a few) options.
John W. Vinson [MVP]