Connecting Tech Pros Worldwide Forums | Help | Site Map

Where am I?

Jim SUTTON
Guest
 
Posts: n/a
#1: Jul 17 '05
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 programmatically 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
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Where am I?


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

On Wed, 30 Jul 2003 14:00:44 +0100, "Jim SUTTON"
<jimSpamMeNot@bradleysutton.net> 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 programmatically 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]

Jim SUTTON
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Where am I?



"Jim SUTTON" <jimSpamMeNot@bradleysutton.net> wrote in message
news:siPVa.9639$R14.9322@news-binary.blueyonder.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 programmatically 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@bradleysutton.net>
Newsgroups: comp.lang.visual.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 programmatically 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...

http://scican2.scican.net/computers/_disc5/0000012d.htm

Regards

--Jim.


J French
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Where am I?


On Wed, 30 Jul 2003 15:15:26 +0100, "Jim SUTTON"
<jimSpamMeNot@bradleysutton.net> 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
Closed Thread