Results 1 to 6 of 6
  1. #1
    Join Date
    May 2005
    Posts
    126
    Provided Answers: 1

    Question Unanswered: Retrieve Current Directory Path (Code)

    Hi, I need some help please

    Using Access 2007

    I have checked the code bank, with no such luck, may its the way I'm carrying out my search

    I need to be able to retrieve and display the current directory path of where the database is stored, so that I can pass on the result to another procedure.

    E.G., If I moved the database from C:\temp\templates to S:\temp\templates, I can retrieve the new directory path

    Thanks

    Mark

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    CurDir("") will give you the entire currrent path, not including the file name.

    Sam

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Strangely, on testing in v2003, after moving the file to another Folder,

    CurDir("")


    returns the path that the file originally resided in, not the new/current Folder!

    CurrentDb.Name

    returns the current path and the file name, so

    Left(CurrentDb.Name, InStrRev(CurrentDb.Name, "\") - 1)

    will return just the current path.

    Linq ;0)>
    Last edited by Missinglinq; 03-19-12 at 18:19.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can also use:
    Code:
    CurrentProject.Path
    See: Properties
    Have a nice day!

  5. #5
    Join Date
    May 2005
    Posts
    126
    Provided Answers: 1
    Thanks

    For all your responses Guy's, very helpful

    Mark

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •