dbTalk Databases Forums  

Transfer data from one Access db to another (both access 2000)

comp.database.ms-access comp.database.ms-access


Discuss Transfer data from one Access db to another (both access 2000) in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Amber S.
 
Posts: n/a

Default Transfer data from one Access db to another (both access 2000) - 12-19-2003 , 01:08 PM






I have a master db and a HR db. While in the HR db, by the click of a
button I would like the following to be automated:
1) Create a copy of master, place it in a separate folder and rename
it. (I have figured this much out so far)
2) Insert data from a select query within the HR db into an empty
table within the copy of master db. This table is linked within my
relationships to two separate tables
3) Insert a single piece of numeric data from a table within HR db
into a separate empty table within the copy of master db (this table
is also linked to many other tables).

I also have a separate button, that when clicked will automate an
import of all data from the copy of master I had created after a user
has input data. Any suggestions would be greatly appreciated.

Thanks and Merry Christmas,
Amber S.

Reply With Quote
  #2  
Old   
Amber S.
 
Posts: n/a

Default 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!!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.