Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What happened to COPYOBJECT 1

Status
Not open for further replies.

ToyFox

Programmer
Jan 24, 2009
161
US
I have a process that I need to automate.
I get two new files weekly that come in named xxxTemp.
I delete the old xxx table and need to rename the xxxTemp to xxx.

I thought there was a COPYOBJECT that I could use with a macro.
 
How about GetObject?

Cogito eggo sum – I think, therefore I am a waffle.
 
Kill FileNameIncPath >> Will delete a local file
eg.
BackEnd = CurrentProject.Path & "\Database_BE.mdb"
Kill BackEnd

FileCopy NewFileNameIncPath, LocalFileNameIncPath >> will copy a file to a specified location
eg.
serverpath = "P:\Backup\Database.mdb"
servercopy = CurrentProject.Path & "\Database.mdb"

FileCopy servercopy, serverpath

Name FileNameIncPath As NewfileName >> will rename an existing file name
eg.
BackEnd = CurrentProject.Path & "\Database.mdb"
Name BackEnd As BackEnd & ".bak"

HTH << MaZeWorX >> Remember amateurs built the ark - professionals built the Titanic [flush]
 
You could
1. delete the records from table xxx
2. import the records from xxxTemp
3. delete the records from xxxTemp.

running 3 sql statements

Code:
DELETE FROM xxx

INSERT INTO xxx SELECT xxxTemp.* FROM xxxTemp

DELETE FROM xxxTemp

I think copying an object does a lot more work than clearing target table and copying from source.
Obviously source table is cleared on the next step
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top