Re: Transfer data from one Access db to another (both access 2000) -
12-26-2003
, 12:42 PM
I finally figured out how to do this!!
I used the following code:
'create a copy of the Text Files folder and place in Applications
folder
Set fs = CreateObject("Scripting.FileSystemObject")
fs.copyfolder Pathnm & "\Text_files", Pathnm & "\Applications\" &
NewAppName
'create copy of EmpAppDB.mdb within the newly created folder within
the
'Applications folder
DBEngine.CompactDatabase Pathnm & "\master\Master_EmpAppdb.mdb",
Pathnm & "\Applications\" & NewAppName & "\" & NewAppName & ".mdb"
'query all open positions and insert them into the copy of
EmpAppDb.mdb
DoCmd.RunMacro "Open_Positions", 1 'finds all positions that are
marked open
DoCmd.TransferText acExportDelim, , "Open_Positions_for_Export",
Pathnm _
& "\Applications\" & NewAppName & "\Open_Positions_for_export.txt",
True
DoCmd.TransferText acExportDelim, , "Next_App_ID", Pathnm &
"\Applications\" & _
NewAppName & "\Next_App_ID.txt", True
I then used transfer text to get the data into my newly created
database.
Just FYI for anyone that might have been formulating an answer to this
mess!! |