Re: Cannot run a file from Access



Thanks, will this work in Access 97 - The computers this database runs on is
using Access 97.
"David W. Fenton" <XXXusenet@xxxxxxxxxxxxxxxxxxx> wrote in message
news:Xns992DB7C2BD45f99a49ed1d0c49c5bbb2@xxxxxxxxxxxx
"Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx> wrote in
news:u2zhBy7kHHA.3280@xxxxxxxxxxxxxxxxxxxx:

\DIR\File.pdf isn't a complete reference to a file. You need
either a drive letter, or a \\server\share in front of that.

Are you sure? Won't Windows resolve it relative to the current
directory?

In testing, I found that any valid path that is begun *not* with a \
is OK, dependent on the current directory (CurDir() returns this).

So, if the directory named "DIR" is in the current directory, then
this should work:

Shell("Dir\ExecutableFile.exe")

Of course, how an argument passed to an executable is handled will
depend on how that executable is written.

In the case of trying to open a data file, I'd use the ShellExecute
API, instead (using Dev's HandleFile wrapper,
http://www.mvps.org/access/api/api0018.htm).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/


.



Relevant Pages

  • Re: linked field in same directory
    ... I am stuck with the drive letter, I am a student and work ... database being independently operated, they wont be ... >>computers throughout the day. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Cannot run a file from Access
    ... either a drive letter, or a \\server\share in front of that. ... API, instead (using Dev's HandleFile wrapper, ... Any particular preference to that API over FollowHyperlink? ...
    (microsoft.public.access.gettingstarted)
  • Re: Cannot run a file from Access
    ... either a drive letter, or a \\server\share in front of that. ... Won't Windows resolve it relative to the current ... dependent on the current directory (CurDir() returns this). ... API, instead (using Dev's HandleFile wrapper, ...
    (microsoft.public.access.gettingstarted)

Loading