Mulitple unknown databases

  • Thread starter Charles D Clayton Jr
  • Start date
C

Charles D Clayton Jr

I have received a couple hundred small A97 database that have the same
format (i.e. 5 tables) but with different names. What is the
best/most efficient way to go about importing the data from one of
those tables from all of the databases? The table has text and number
(double) fields but no autonumber. It is a field generated from an
AutoCad drawing. I really do not want to try to open each database
one at a time to import the data.

Thanks,

Charles D Clayton Jr
 
J

Joe Fallon

This is how it can be done for Text files.
You can modify this and use TransferDatabase (with different parameters).
If you get it working, please post your code!

How to Import all Files in a Folder:

Private Sub btnImportAllFiles_Click()
'procedure to import all files in a directory and delete them.
'assumes they are all the correct format for an ASCII delimited import.
Dim strfile As String

ChDir ("c:\MyFiles")
strfile = Dir("FileName*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, "ImportSpecName", "AccessTableName",
"c:\MyFiles\" & strfile, True
'delete the file (consider moving it to an Archive folder instead.)
Kill "c:\MyFiles\" & strfile
strfile = Dir
Loop

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top