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

Shell Woes

P: n/a
A2003 I want to make a copy of the current back end (and later will
delete the data in it and compact it). I've chosen to try and use the
shell command and the DOS command copy.

I try to run the shell command from a line of code that looks like this:

Shell "copy """ & strCurFile & """ """ & strNewFile & """", vbHide

Where strCurFile and stNewFile are the full paths to the current
database back end and a new copy of the back end, respectively.

The proc stops on this line of code and throws error 53, file not found.
A debug.print of the stuff after the Shell gives:

copy "C:\Documents and Settings\tim\My
Documents\Access2003\Campaign\Data.mdb" "C:\Documents and
Settings\tim\My Documents\Access2003\Campaign\a.mdb"

Which works as expected when pasted to the command prompt window.

I suspect Access is looking for the path to the copy command.

DO I need to wade through the windows files to find this old dos command
and get the full path or is there a better way? Indeed, what about
other PCs? WIll they all have copy in the same path?

Are there any alternatives to the approach I'm taking to accomplish what
I describe in the first paragraph?

TIA. 8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Wed, 26 Jan 2005 22:57:45 -0330, Tim Marshall
<Sc**********@Im.Going.Home> wrote:

Rather than trying to debug this, why not use VBA's FileCopy function?

-Tom.
A2003 I want to make a copy of the current back end (and later will
delete the data in it and compact it). I've chosen to try and use the
shell command and the DOS command copy.

I try to run the shell command from a line of code that looks like this:

Shell "copy """ & strCurFile & """ """ & strNewFile & """", vbHide

Where strCurFile and stNewFile are the full paths to the current
database back end and a new copy of the back end, respectively.

The proc stops on this line of code and throws error 53, file not found.
A debug.print of the stuff after the Shell gives:

copy "C:\Documents and Settings\tim\My
Documents\Access2003\Campaign\Data.mdb" "C:\Documents and
Settings\tim\My Documents\Access2003\Campaign\a.mdb"

Which works as expected when pasted to the command prompt window.

I suspect Access is looking for the path to the copy command.

DO I need to wade through the windows files to find this old dos command
and get the full path or is there a better way? Indeed, what about
other PCs? WIll they all have copy in the same path?

Are there any alternatives to the approach I'm taking to accomplish what
I describe in the first paragraph?

TIA. 8)


Nov 13 '05 #2

P: n/a
Tom van Stiphout wrote:
Rather than trying to debug this, why not use VBA's FileCopy function?


Because I'm stupid? 8)

Thanks Tom, that's exactly what I need. Apppreciate your follow up.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.