View Full Version : Get Home Directory


jeffbruce
07-12-2007, 01:12 PM
I have an Access database linked with VB.

Here's what I'd like to do:
Use the TransferText method to create a file (which I have done) and save it in the same directory as the Access database.

Here's what I'd like to know:
Is there is a built-in VB function for retrieving the path name of the Access database and storing it as type String?

e.g.
Say I have an Access database called C:\idioteque.mdb
I want a method that returns C:\

another e.g.
Say I have an Access database called F:\PinkerSlipCanyon\IndustrialPaycheck\HunchMonkey \paydirt.mdb
return F:\PinkerSlipCanyon\IndustrialPaycheck\HunchMonkey \

Thanks.

Moniker
07-12-2007, 01:48 PM
Umm... Did you search at all?

CurrentProject.Path

So, for a string:

YourStringName = CurrentProject.Path

jeffbruce
07-12-2007, 01:51 PM
Exactly what I was looking for, thanks a million.