473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 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.
Jul 17 '05 #1
3 4938
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"
<ji**********@bradleysutton.net> wrote:
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.


Jul 17 '05 #2

"Jim SUTTON" <ji**********@bradleysutton.net> wrote in message
news:si*****************@news-binary.blueyonder.co.uk...
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.
Problem Sorted!

----- Original Message -----
From: "Jim SUTTON" <ji**********@bradleysutton.net>
Newsgroups: comp.lang.visual.basic
Sent: Wednesday, July 30, 2003 2:00 PM
Subject: 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 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.


Found my answer here...

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

Regards

--Jim.
Jul 17 '05 #3
On Wed, 30 Jul 2003 15:15:26 +0100, "Jim SUTTON"
<ji**********@bradleysutton.net> wrote:

<snip>
Found my answer here...

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


That is a really stupid solution

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

Use of InStr() like that is ... poor practise
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
3
by: A.V.C. | last post by:
Hello, I found members of this group very helpful for my last queries. Have one problem with CASE. I can use the column name alias in Order By Clause but unable to use it in WHERE CLAUSE. PLS...
3
by: Xiangliang Meng | last post by:
Hi, all. In 1998, I graduated from Computer Science Dept. in a university in China. Since then, I've been using C Language for almost 6 years. Although I'm using C++ in my current job, I'm also...
7
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex...
5
by: comp.lang.php | last post by:
if ($willLimitByDB) $sql = preg_replace('/#(+)#/i', '$$1', $sql); This does not give me the results I want, instead of the value of $where in $sql, I literally get '$where' instead. How do I...
5
by: John | last post by:
I just cannot manage to perform a SELECT query with NULL parameter... My CATEGORY table does have one row where TCATEGORYPARENTID is null (real DB null value). TCATEGORYID and TCATEGORYPARENTID...
0
NeoPa
by: NeoPa | last post by:
Background Whenever code is used there must be a way to differentiate the actual code (which should be interpreted directly) with literal strings which should be interpreted as data. Numbers don't...
1
by: not_a_commie | last post by:
I was hoping for increased functionality with the where clause in C# 3.0. Using the new keyword 'var' would really allow us to take nice advantage of these. Specifically: 1. I want to limit it...
9
by: Emin | last post by:
Dear Experts, I have a fairly simple query in which adding a where clause slows things down by at least a factor of 100. The following is the slow version of the query ...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.