Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 14th, 2009, 03:11 PM
Member
 
Join Date: May 2007
Posts: 95
Default need to copy a file from one location to another within access - ties up application

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!
Reply
  #2  
Old January 15th, 2009, 01:26 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

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.
Reply
  #3  
Old January 15th, 2009, 01:45 PM
Member
 
Join Date: May 2007
Posts: 95
Default

Quote:
Originally Posted by NeoPa View Post
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.
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?
Reply
  #4  
Old January 15th, 2009, 05:48 PM
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Age: 48
Posts: 14,330
Default

Quote:
Originally Posted by ncsthbell View Post
Right now my 'Test.bat' file contains the following statements:
Expand|Select|Wrap|Line Numbers
  1. COPY C:\Testdb.mdb, T:\Testdb.mdb 
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).
Quote:
Originally Posted by ncsthbell View Post
are you suggesting trying instead?
Expand|Select|Wrap|Line Numbers
  1. Call Shell(Test.bat)
Fundamentally yes.
Quote:
Originally Posted by ncsthbell View Post
Not sure I understand about the Cmd file. I have never used one before. Would the cmd file initiate the copying?
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
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.