Re: Name function in Access 2002 (XP)

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 09/09/04


Date: Thu, 9 Sep 2004 22:53:01 +0800

There are *myriads* of reasons that a rename can fail, e.g.:
- the old file name does not exist;
- the path is invalid;
- the network connection is not available;
- the drive is empty;
- the disk is corrupted (chkdsk error);
- the new file name is invalid (bad characters, too long, ...);
- the new name includes a path that does not yet exist);
- the media is not writable (CD-ROM);
- the disk is write protected;
- you do not have write permission to the drive/file/folder;
- the file is currently in use;
- your software is being run on a future file system, and an error occured
that you never imagined;
- many others.

The VBA errors are very specific when there is a problem. The only sensible
approach is to use error handling, and let VBA report what particular error
occurred if there was a problem.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"pvp" <anonymous@discussions.microsoft.com> wrote in message
news:083101c4965b$8b380070$a401280a@phx.gbl...
> Guys, I am doing a complicated series of renames of files
> from Access VBA. I need to know how such a (re)name
> operation can fail so that I know whether to try and
> catch such failures. Has it ever failed to anyone's
> knowledge?
>
> Many thanks. 


Relevant Pages

  • Re: Another fine mess
    ... jobs can fail every minute. ... [[If rename fails, and there is no C, subsequent jobs fail. ... The information contained in this communication (including any ...
    (bit.listserv.ibm-main)
  • Re: Infinity......
    ... This name change is invalid because we did not specify a new ... I cannot rename all of A elements by replacing ... the same absolute size, then the absolute size of A ... elements of one of them by elements from the other without affecting ...
    (sci.math)
  • Re: [PATCH 1/3] tracing/filters: allow user-input to be integer-like string
    ... will fail: ... bash: echo: write error: Invalid argument ...
    (Linux-Kernel)
  • Re: shell scrpt to rename
    ... How do I rename *.foo to *.bar? ... command line buffer), and will fail if any file names contain a ... In some linux distributions you may be able to use the rename ...
    (comp.unix.shell)
  • Re: Corrupt Directory?
    ... error."" I mean that I can rename it to anything I want without a problem, ... >> directory name is invalid. ... > so I already know there were no strange characters in it. ... I studied FAT in depth back when hard ...
    (microsoft.public.win2000.file_system)