Where am I?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim SUTTON

    Where am I?

    Full blown VB6 has a global object called App which I can use to find the
    location in the file system of the exe I am running (App.Path).

    Is there a ready equivalent in VBA? Specifically, I am looking to distribute
    an application in the form of an Access 2000 mdb file ON A CD-ROM with forms
    for user interaction, together with some documents. I need to display the
    documents, calling them by path and name, but I cannot work out how to
    reference programmaticall y from VB within Access "This CD-ROM drive, on
    which this mdb is located, and in the Documents folder thereof".

    Short of a Win API call to find the drive letter of the first CD-ROM drive,
    and hoping that the eventual user only has one CD-ROM drive, any ideas?

    Regards

    --Jim.


  • J French

    #2
    Re: Where am I?

    The API GetModuleFileNa me may be appropriate, if your App is actually
    running from the CD

    On Wed, 30 Jul 2003 14:00:44 +0100, "Jim SUTTON"
    <jimSpamMeNot@b radleysutton.ne t> wrote:
    [color=blue]
    >Full blown VB6 has a global object called App which I can use to find the
    >location in the file system of the exe I am running (App.Path).
    >
    >Is there a ready equivalent in VBA? Specifically, I am looking to distribute
    >an application in the form of an Access 2000 mdb file ON A CD-ROM with forms
    >for user interaction, together with some documents. I need to display the
    >documents, calling them by path and name, but I cannot work out how to
    >reference programmaticall y from VB within Access "This CD-ROM drive, on
    >which this mdb is located, and in the Documents folder thereof".
    >
    >Short of a Win API call to find the drive letter of the first CD-ROM drive,
    >and hoping that the eventual user only has one CD-ROM drive, any ideas?
    >
    >Regards
    >
    >--Jim.
    >
    >[/color]

    Comment

    • Jim SUTTON

      #3
      Re: Where am I?


      "Jim SUTTON" <jimSpamMeNot@b radleysutton.ne t> wrote in message
      news:siPVa.9639 $R14.9322@news-binary.blueyond er.co.uk...[color=blue]
      > Full blown VB6 has a global object called App which I can use to find the
      > location in the file system of the exe I am running (App.Path).
      >
      > Is there a ready equivalent in VBA? Specifically, I am looking to[/color]
      distribute[color=blue]
      > an application in the form of an Access 2000 mdb file ON A CD-ROM with[/color]
      forms[color=blue]
      > for user interaction, together with some documents. I need to display the
      > documents, calling them by path and name, but I cannot work out how to
      > reference programmaticall y from VB within Access "This CD-ROM drive, on
      > which this mdb is located, and in the Documents folder thereof".
      >
      > Short of a Win API call to find the drive letter of the first CD-ROM[/color]
      drive,[color=blue]
      > and hoping that the eventual user only has one CD-ROM drive, any ideas?
      >
      > Regards
      >
      > --Jim.[/color]

      Problem Sorted!

      ----- Original Message -----
      From: "Jim SUTTON" <jimSpamMeNot@b radleysutton.ne t>
      Newsgroups: comp.lang.visua l.basic
      Sent: Wednesday, July 30, 2003 2:00 PM
      Subject: Where am I?

      [color=blue]
      > Full blown VB6 has a global object called App which I can use to find the
      > location in the file system of the exe I am running (App.Path).
      >
      > Is there a ready equivalent in VBA? Specifically, I am looking to[/color]
      distribute[color=blue]
      > an application in the form of an Access 2000 mdb file ON A CD-ROM with[/color]
      forms[color=blue]
      > for user interaction, together with some documents. I need to display the
      > documents, calling them by path and name, but I cannot work out how to
      > reference programmaticall y from VB within Access "This CD-ROM drive, on
      > which this mdb is located, and in the Documents folder thereof".
      >
      > Short of a Win API call to find the drive letter of the first CD-ROM[/color]
      drive,[color=blue]
      > and hoping that the eventual user only has one CD-ROM drive, any ideas?
      >
      > Regards
      >
      > --Jim.[/color]

      Found my answer here...



      Regards

      --Jim.


      Comment

      • J French

        #4
        Re: Where am I?

        On Wed, 30 Jul 2003 15:15:26 +0100, "Jim SUTTON"
        <jimSpamMeNot@b radleysutton.ne t> wrote:

        <snip>[color=blue]
        >Found my answer here...
        >
        >http://scican2.scican.net/computers/_disc5/0000012d.htm
        >[/color]

        That is a really stupid solution

        One should scan back for the rightmost '\' or ':'

        Use of InStr() like that is ... poor practise

        Comment

        Working...