By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,316 Members | 2,355 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,316 IT Pros & Developers. It's quick & easy.

CurDir

P: n/a
Ian
Can someone tell me what CurDir returns, I am trying to find the path to the
Drive letter where Windows is installed on a PC, using code like:

Function DriveLetter()

Dim curdrv As String

curdrv = Left(CurDir, 2)

curdrv = curdrv & "\"

MsgBox "" & curdrv

The help file says that CurDir returns the path for the Current Drive but I
am not sure what CURRENT DRIVE means, is this the drive with the operating
system?

Tanks
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
CurDir returns the full path of the folder that holds the current Database .
Try typing in ?CurDir() in the immediate window

HTH

Phil
"Ian" <ia********@ntlworld.com> wrote in message
news:ZK***************@newsfe3-win.ntli.net...
Can someone tell me what CurDir returns, I am trying to find the path to
the
Drive letter where Windows is installed on a PC, using code like:

Function DriveLetter()

Dim curdrv As String

curdrv = Left(CurDir, 2)

curdrv = curdrv & "\"

MsgBox "" & curdrv

The help file says that CurDir returns the path for the Current Drive but
I
am not sure what CURRENT DRIVE means, is this the drive with the operating
system?

Tanks

Nov 13 '05 #2

P: n/a
Phil Stanton wrote:
CurDir returns the full path of the folder that holds the current
Database . Try typing in ?CurDir() in the immediate window


No it doesn't. It returns whatever folder Windows considers the current
directory which might or might not be the one where the MDB resides.

You can use...

CurrentDB.Name
or
CurrentProject.Path (Access 2000 or newer)

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #3

P: n/a
Ian
So how can I find the path to the Drive letter where Windows is installed on
a PC, which I would call the Current Drive. If my operating system is on the
D Drive I want it to return D:\
Any ideas?
Nov 13 '05 #4

P: n/a

"Ian" wrote
Can someone tell me what CurDir
returns, I am trying to find the path
to the Drive letter where Windows
is installed on a PC, . . .


As Rick stated, CurDir returns whatever Windows considers the "currently
selected directory", which isn't what you want. Rick gave you what is needed
to return the Folder where the current database or project is stored. And,
there is a Windows API that will return the information you want about
Windows. You'll find Access example code for using it at
http://www.mvps.org/access/api/api0010.htm.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #5

P: n/a
Ian

"Larry Linson" <bo*****@localhost.not> wrote in message
news:REWJd.944$SP4.577@trnddc07...

"Ian" wrote
> Can someone tell me what CurDir
> returns, I am trying to find the path
> to the Drive letter where Windows
> is installed on a PC, . . .
As Rick stated, CurDir returns whatever Windows considers the "currently
selected directory", which isn't what you want. Rick gave you what is

needed to return the Folder where the current database or project is stored. And,
there is a Windows API that will return the information you want about
Windows. You'll find Access example code for using it at
http://www.mvps.org/access/api/api0010.htm.

Larry Linson
Microsoft Access MVP


Thank Larry

That is exactly what I need, I did check this web site first but somehow
missed it. This is not the first time you have helped me and I do appreciate
it.

Regards
Nov 13 '05 #6

P: n/a
"Ian" wrote
Thank Larry
You're welcome. I'm glad I was able to be of some assistance.
That is exactly what I need, I did
check this web site first but somehow
missed it.
There's so much there that it is easy to overlook something. In fact, I had
to visit there to make sure I remembered correctly that there was such an
article.
This is not the first time you have
helped me and I do appreciate
it.


Your appreciation makes it worthwhile. Again, you are most welcome. Helping
is what newsgroups are for.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.