[AccessD] copying a table from every database in a folderinto another database

Stuart McLachlan stuart at lexacorp.com.pg
Wed Aug 11 23:03:54 CDT 2004


On 11 Aug 2004 at 22:54, JMoss wrote:

> I have a folder that contains from 90 - 110 Monarch generated Access
> databases with one non Msys type table each, each table is uniquely named
> the same as the database. How can I append a table from each database into
> another Access database? I can user fs to loop through the folder and get
> the table names. Could someone point me in the right direction?
> 

Something like this?

Function GetTables(Directory As String) As Long
Dim strFilename As String
DIim strTablename as String

ChDir Directory
strFilename = Dir$("*.mdb")
strTablename = Left$(strFilename, Len(strFilename) - 4)
While strFilename > ""
	DoCmd.TransferDatabase acImport, , strFilename, acTable, _
         strTablename, strTablename
      strFilename = Dir$()
Wend

End Function

-- 
Stuart





More information about the AccessD mailing list