Access Version: 2002 SP3
OS: MS Windows XP Professional
Code from Module:
Dim txtFileNameBuES As String
Dim txtFileNameBuESXP As String
Dim txtPathNameBuTo As String
txtFileNameBuES = DLookup("[ESPCLoc]", "Variables")
txtFileNameBuESXP = DLookup("[DBLoc]", "Variables")
txtPathNameBuTo = DLookup("[BackupLoc]", "Variables")
cpyst1 = Chr$(34) & txtFileNameBuES & Chr$(34)
cpyst2 = Chr$(34) & txtFileNameBuESXP & Chr$(34)
cpyst3 = Chr$(34) & txtPathNameBuTo & "\ExpressScore.mdb" & Chr$(34)
cpyst4 = Chr$(34) & txtPathNameBuTo & "\ExpressScoreXP.mdb" & Chr$(34)
FileCopy cpyst1, cpyst3
FileCopy cpyst2, cpyst4
---
Contents of fields in table:
txtFileNameBuES=C:\Program Files\WorkKeys\Working\ExpressScore.mdb
txtFileNameBuESXP=C:\Program Files\WorkKeys\Working\ExpressScore.mdb
txtPathNameBuTo=C:\WorkKeys\Backup
I am trying to make a copy of two files ES and ESXP into the backup folder. Different sites using this have different locations for their files, so I'd prefer not to hardcode the path.
I get the error message listed in the Title. Not sure how to use the Immediate indow in Debug to check, or what else to do. I have been searching all day with no luck. Thanks.
7 15801
Hello Tracy, try: - Dim txtFileNameBuES As String
-
Dim txtFileNameBuESXP As String
-
Dim txtPathNameBuTo As String
-
-
txtFileNameBuES = DLookup("[ESPCLoc]", "Variables")
-
txtFileNameBuESXP = DLookup("[DBLoc]", "Variables")
-
txtPathNameBuTo = DLookup("[BackupLoc]", "Variables")
-
-
FileCopy txtFileNameBuES, txtPathNameBuTo & "\ExpressScore.mdb"
-
FileCopy txtFileNameBuESXP, txtPathNameBuTo & "\ExpressScoreXP.mdb"
YEESSSSS!!! Thank you very much, that worked perfectly!!!
YEESSSSS!!! Thank you very much, that worked perfectly!!!
You are quite welcome. I guess you can now change you name from TracyWants2Know to TracyNowKnows! (LOL).
What if I wanted to copy multiple files into one?
FileCopy C:\WorkKeys\Rock.txt+Chester.txt, C:\WorkKeys\AllFiles.txt
What if I wanted to copy multiple files into one?
FileCopy C:\WorkKeys\Rock.txt+Chester.txt, C:\WorkKeys\AllFiles.txt
I'm almost positive that you cannot do that with FileCopy, but all is not lost if the know the File Names and their locations ahead of time. You can create a Batch File that easily performs the multiple File copies, then execute it. The following code will copy the Files One.txt and Two.txt in the C:\Test Directory to the C:\Windows Directory. They will be concatenated and combined into a single File named Big.txt. The Copy process will be verified (/V) and there will no no Overwrite Warning (/Y) should the Destination File exist. Make sure to give the File a *.bat extension and if you need further help, let me know: -
'Contents of CopyMany.bat
-
@Echo Off
-
cls
-
Cd\Test
-
Copy /V /Y 1.txt + 2.txt C:\Windows\Big.txt
Can I do this as a Call Shell(Copy ...) or something other than a batch file? I'd like to have all of the code within my access database and not have to distribute a separate batch file too.
Can I do this as a Call Shell(Copy ...) or something other than a batch file? I'd like to have all of the code within my access database and not have to distribute a separate batch file too.
Can I do this as a Call Shell(Copy ...) or something other than a batch file? I'd like to have all of the code within my access database and not have to distribute a separate batch file too?
I don't think that this can be accomplished internally within Access, but then again, I nevr had a reason to attempt it.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Victoria Chin |
last post by:
Could someone point me in the right direction? I've
migrated three FrontPage 2002 websites to a new web
server. Each web site has a Access 2000 database on the
data server. I have the global.asa...
|
by: swathky |
last post by:
I've tried mutiple things but no go -- (sorry this is so long)
I'm collecting a 5 digit number in an input box function and all works
fine until a number is passed that doesn't exist in the...
|
by: Aleksandar |
last post by:
Hi,
I need to convert set of Java classes exported from IBM Modeling environment
to C# for implementation.
When I invoke JCLA conversion from File->Open->Convert in Visual Studio 2005
it starts...
|
by: kalyanijala |
last post by:
Hi There,
I have a problem running a VB program.
This programs actually reads a DAT file and gives the best CPU time taken to run the program.
for example I'm reading files like TN3004, TN3104 ,...
|
by: g_man |
last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of
a command button that closes the form. I have code in the Form_Error
event that does a good job of providing a more meaningful...
|
by: Bob |
last post by:
I'm not sure why this is happening. Using Access 2003. My code is as
follows...
Private Sub Command1_Click()
Dim strSourceFile As String
Dim strDestinationFile As String
strSourceFile =...
|
by: rohitdoke |
last post by:
Hello,
we are using IIS 6.0 and facing an error as
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'verifychecksum'
...
|
by: morrisqueto |
last post by:
Hello,
One of my websites just started sending a new rare error. The site has been working for almost 2 years without trouble, but today morning started giving away this error in all my views.
...
|
by: suganya |
last post by:
Hi
Some professionals already has developed the project using menu. In my company, they have given me task to clear the error in that. It is a script file named as "menubarAPI4.js" which is kept...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |