By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

need to copy a file from one location to another within access - ties up application

100+
P: 167
I support an access (2000) application. I have a request to copy this application to another location from within the application. I have used the the filescriptingobject fs.copyfile, it leaves the app open until the copy is complete. I also created a DOS .bat file to do the copy and I execute this from within the application but it also leaves the app open until the copy is complete. I can physically close the app, but the DOS window stays open. The app is large so it takes about 30 minutes to copy (with the fact that the servers are located elsewhere). I can not leave the app open while this copy takes place. I am running out of ideas... does anyone have any suggestions?
What I would really like is to be able to initiate the copy in the background so it can't be seen and be able to return to the form (where the cmdbutton was to initiate it) and have the user exit the application.
THanks!
Jan 14 '09 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,186
The Shell() function works asynchronously. Would this resolve your problem?

A Cmd file (similar to .Bat) can be set up using PAUSE to allow you to continue only after the user has quit the db.
Jan 15 '09 #2

100+
P: 167
@NeoPa
Right now my 'Test.bat' file contains the following statements:
Expand|Select|Wrap|Line Numbers
  1. COPY C:\Testdb.mdb, T:\Testdb.mdb 
are you suggesting trying instead?
Call Shell(Test.bat)
Not sure I understand about the Cmd file. I have never used one before. Would the cmd file initiate the copying?
Jan 15 '09 #3

NeoPa
Expert Mod 15k+
P: 31,186
@ncsthbell
Firstly, I would remove the comma (,) from the command. That is incorrect syntax and may cause problems (May be an irrelevant typo of course too).
@ncsthbell
Fundamentally yes.
@ncsthbell
If, after fixing your .BAT file you were to rename it to Test.Cmd, then you could say instead :
Expand|Select|Wrap|Line Numbers
  1. Call Shell(Test.Cmd)
I would also consider adding PAUSE lines before and/or after the COPY to allow you to synchronise the copy after the database has been closed, as well as to allow you to see that it had completed ok.

Possibly something like :
Test.Cmd
Expand|Select|Wrap|Line Numbers
  1. PAUSE
  2. COPY C:\Testdb.mdb T:\Testdb.mdb
  3. PAUSE
Jan 15 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.