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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COPY FILE issue 1

Status
Not open for further replies.

huntert

Technical User
Jan 16, 2003
23
0
0
US
This is an extension of previous question about syncronizing server and laptop DB. The previous comments were very helpful and appreciated. I ended up using an sql created arrays from the laptop DB files and then appended from the array to the server DB files.

My new question relates to copying the data folder from the server copy to the laptop so I can go out a roam with an updated version.

I sign on from laptop and connect to the data folder on the server. My routine to upload the data file from the server is briefly...

CLOSE DATABASES ALL

COPY FILE "C:.(serverDB)..\DATAFOLDER" TO [\\.(laptopDB)..\DATAFOLDER]

OPEN DATABASE(laptopDB)

... seems to copy all the data tables in the folder without problem until the error 'file in use occurs'. I believe this occurs when it tries to copy the DBC.dbt file. The copy process moves thru the files alphabetically and ends at this point.

Is this what is happening and how can I work around this? The DBC file must be in use and though I have close the databases/tables ... the DBC.dbt remains in use. For speed reasons, copying the entire folder is much faster. Down the road what problems will I have doing this while others want to use the server DB. WIll they have to close out before any uploading in this manner?

I very much appreciate the help you all have given in the past. Thanks again in advance. hunter
 

Use copy for DOS, it copies open files. Just create a bat(ch) file and run it.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
or you can use windows scripting.
Code:
ofilesys = CreateObject("Scripting.FileSystemObject")
ofilesys.CopyFolder("\\Project\project\00\DBSource", "c:\tmp\DBTarget")

hope this helps. peace! [peace]

kilroy [trooper]
philippines

"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get one million miles to the gallon, and explode once a year, killing everyone inside."
 
I appcreciate the help. I used the 2 line code suggest and it seemed to work fine but it ended in this error message
'OLERROR code 0x800a0046: Unknow COM status code'
What does this mean and what can I do about this?
Thanks much. hunter
 
Hi Mike.
I had that loaded and I still get the same error message. The code works but then end with the error message. Any other thoughts? What was your suggestion about Copy for DOS. I am not sure what you mean by that. Thanks again. hunter
 
I use a batch file (.bat) that contains lines that look like this. And when I need to copy the files I just double-click on the batch file (or put it in the task scheduler)

Code:
copy E:\Service\suncsc\admin.dbc E:\Dev\suncsc\admin.dbc /y
copy E:\Service\suncsc\admin.dct E:\Dev\suncsc\admin.dct /y
copy E:\Service\suncsc\admin.dcx E:\Dev\suncsc\admin.dcx /y

copy E:\Service\suncsc\suntel.dbc E:\Dev\suncsc\suntel.dbc /y
copy E:\Service\suncsc\suntel.dct E:\Dev\suncsc\suntel.dct /y
copy E:\Service\suncsc\suntel.dcx E:\Dev\suncsc\suntel.dcx /y


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
=ADIR(aFiles,"data\*.*")

DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
STRING @SourceFileName, ;
STRING @DestFileName, ;
INTEGER bFailIfExists

FOR nT = 1 TO ALEN(aFiles,1)
nSucces=CopyFile(SYS(5)+SYS(2003)+"\data\"+aFiles; [nT,1], SYS(5)+SYS(2003)+"\dataexport\"+aFiles[nT,1],0)
IF nSucces = 0
wait window aFiles[nT,1]
exit
ENDIF
ENDFOR

Its not copying the whole folder but this may get what you want.

Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top