Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

    Unanswered: Retreiving CurentDB Location

    Hopefully this'll just be a quicky but I simply can't find a quick and easy method.

    How can I return the file path for the database that is open? I'm assuming there is an inbuilt function that I am missing, but I cannot find it!

    -George
    George
    Home | Blog

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    Hopefully this'll just be a quicky but I simply can't find a quick and easy method.
    Code:
    CurrentDB.Name
    Quick and easy enough for ya?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Nice and swift post edit Poots :P
    I actually just discovered this also:
    Code:
    CurrentProject.FullName
    which appears to work...
    So here's the second part:
    Code:
    Debug.Print CurrentDb.Name
    Debug.Print CurDir(CurrentDb.Name)
    ----
    C:\Documents and Settings\******\My Documents\Access\db1.mdb
    C:\Documents and Settings\******\My Documents
    I want to return the folder which the database is in - but CurDir is not giving me the correct location *sigh*
    George
    Home | Blog

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Ahh screw it - I worked out a dirty little solution as soon as I posted
    Code:
    FilePath = Left(CurrentDb.Name, (len(CurrentDb.Name) - len(Dir(CurrentDb.Name))))
    But surely there's a cuter way (inbuilt)?

    EDIT: Why George, yes there is!
    Code:
    CurrentProject.Path
    Last edited by gvee; 05-14-07 at 09:59.
    George
    Home | Blog

Posting Permissions

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