473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Copy from a variable Directory to a Fixed Location

Hi:

I need to copy the entire directory that my .mdb file is sitting in to another drive and
directory, and am having trouble with the syntax.

The following is intended to copy the contents of the full directory the mdb is in into a
directory called: C:/pie

Function CopyBack()
ThisPlace = CurrentProject.Path
fromfile= (ThisPlace)&/*.*
FileCopy fromfile, C:/pie/*.*
End Function

Being a bit slow on the uptake, I have a problem with the syntax and am uncertain how to
resolve it. Your help would be appreciated.

Best

John Baker
Nov 13 '05 #1
5 1854
Chuck I tried this today, and it comes back with the fact that it contains a function that
can not be found. Any ideas? Note that this is Access 2000, and i suppose could lack the
File Copy!

Best

John Baker

Chuck Grimsby <c.*******@worldnet.att.net.invalid> wrote:
ThisPlace = CurrentProject.Path
fromfile = dir$(ThisPlace & "\*.*")
While fromFile <> ""
FileCopy thisplace & "\" & fromfile, _
"C:\pie\" & fromfile
fromfile = Dir
Wend


Nov 13 '05 #2
HJ
It sounds like a missing reference or an incorrect reference priority order.
Check the Microsoft DAO 3.6 Object Library and the Microsoft Visual Basic
for Applications Extensibility 5.3 references. You may need to change the
priority.

HJ

"John Baker" <Ba******@Verizon.net> wrote in message
news:cr********************************@4ax.com...
Chuck I tried this today, and it comes back with the fact that it contains a function that can not be found. Any ideas? Note that this is Access 2000, and i suppose could lack the File Copy!

Best

John Baker

Chuck Grimsby <c.*******@worldnet.att.net.invalid> wrote:
ThisPlace = CurrentProject.Path
fromfile = dir$(ThisPlace & "\*.*")
While fromFile <> ""
FileCopy thisplace & "\" & fromfile, _
"C:\pie\" & fromfile
fromfile = Dir
Wend

Nov 13 '05 #3
Chuck:

Thanks very much -- that was exactly what I needed.

Best

John Baker

Chuck Grimsby <c.*******@worldnet.att.net.invalid> wrote:
ThisPlace = CurrentProject.Path
fromfile = dir$(ThisPlace & "\*.*")
While fromFile <> ""
FileCopy thisplace & "\" & fromfile, _
"C:\pie\" & fromfile
fromfile = Dir
Wend


Nov 13 '05 #4
Chuck I tried this today, and it comes back with the fact that it contains a function that
can not be found. Any ideas? Note that this is Access 2000, and i suppose could lack the
File Copy!

Best

John Baker

Chuck Grimsby <c.*******@worldnet.att.net.invalid> wrote:
ThisPlace = CurrentProject.Path
fromfile = dir$(ThisPlace & "\*.*")
While fromFile <> ""
FileCopy thisplace & "\" & fromfile, _
"C:\pie\" & fromfile
fromfile = Dir
Wend


Nov 13 '05 #5
HJ
It sounds like a missing reference or an incorrect reference priority order.
Check the Microsoft DAO 3.6 Object Library and the Microsoft Visual Basic
for Applications Extensibility 5.3 references. You may need to change the
priority.

HJ

"John Baker" <Ba******@Verizon.net> wrote in message
news:cr********************************@4ax.com...
Chuck I tried this today, and it comes back with the fact that it contains a function that can not be found. Any ideas? Note that this is Access 2000, and i suppose could lack the File Copy!

Best

John Baker

Chuck Grimsby <c.*******@worldnet.att.net.invalid> wrote:
ThisPlace = CurrentProject.Path
fromfile = dir$(ThisPlace & "\*.*")
While fromFile <> ""
FileCopy thisplace & "\" & fromfile, _
"C:\pie\" & fromfile
fromfile = Dir
Wend

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Andrew | last post by:
Hi, I want to copy a file from a variable location "C:\...\myDocument\thisfile.txt" to a destination D:\data\ How can I do that? I tried to get the path from <input tyep=file>, but I couldn't...
1
by: Antonio Lopez Arredondo | last post by:
hi all !!! I need to copy a folder and its subfolders to another location; which class should I use ? could only find the System.IO.Directory.MOVE but don't know how to COPY. thanks in...
1
by: John Baker | last post by:
Hi: I need to copy the entire directory that my .mdb file is sitting in to another drive and directory, and am having trouble with the syntax. The following is intended to copy the contents...
2
by: karen.mcdonagh | last post by:
I am trying to copy a file with a css extension using the following code if (!DoesDirectoryExists(sLocation)) { //Create the directory Directory.CreateDirectory(sLocation); } FileInfo test...
11
by: F. Michael Miller | last post by:
I'd like to copy the listing of a directory (& sub directories) to a text file in vb.net. I'm looking for teh equivilant of the DOS command dir /s > TargetFile.txt. Thanks!
2
by: Diffident | last post by:
Hello All, I just finished reading an interesting article by Scott about App Domains: http://odetocode.com/Articles/305.aspx Scott, I have a question about the section "Shadow Copies and...
0
by: weiwei | last post by:
Hi; I am having trouble to get variable from grid view. here is my scenario. I want to delete a row in database from web page, in additon, I also want to delete that user's directory in c:drive. ...
12
by: samoore33 | last post by:
I found a real nice article on how to copy a directory on MSDN. The only problem is that I can not figure out how to get the namespace Microsoft.VisualBasic.MyServices. I wanted to know if anyone...
15
by: subramanian100in | last post by:
consider the following program: #include <iostream> using namespace std; class Test { public: Test(int xx) : x(xx) { cout << x << endl; }
10
by: Jason | last post by:
I want to create a simple program with Two buttons on the form. BUTTON 1 - BACKUP PREFS this will do the following: Copy C:\Documents and Settings\%USERNAME%\Application Data\FileZilla...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.