Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    163
    Thanks
    2
    Thanked 0 Times in 0 Posts

    file path truncating (Access 97)

    HI,
    I've used the following code to show the filepath on my reports.

    Option Compare Database 'Use the following to return the path of the current db
    Option Explicit
    '
    Function CurrentDBDir() As String
    Dim strDBPath As String
    Dim strDBFile As String
    strDBPath = CurrentDb.Name
    strDBFile = Dir(strDBPath)
    CurrentDBDir = Left(strDBPath, Len(strDBPath) - Len(strDBFile)) & strDBFile

    End Function

    On my own database is works fine and show the full path as R:databaseresponsibilities.mbd.

    I tried to set up a procedures document, so that others in the department would know how to insert the filepath (company requirement). I used an old database on the same server (different drive) and was taking screen shots of each step. However when I got to the end, the file path appears truncated on the report

    M:CommonDEPARTM~1DATABA~1Vendors.mdb

    I tried removing everything else from the footer, increasing the size of the text box, but nothing seems to work so that the full filepath will display. It was suggested to me that is was because the older database exceeds the 8 character limit. If that was the case, then why would my database show the full database name?

    Can anyone suggest what the problem might be?
    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: file path truncating (Access 97)

    You didn't indicate which operating system you were using, but it looks like you've got folders with spaces in their names. The truncated path *IS* the full path the way Windows sees it. So ...

    M:CommonDEPARTMENT ADATABASE 1Vendors.mdb

    gets read as ...

    M:CommonDEPARTM~1DATABA~1Vendors.mdb

    while ...

    R:databaseresponsibilities.mbd

    is read as written.

    In fact, the "truncated" path is perfectly valid, and you can use it to go to the secified file. If you hit the start button on the taskbar, select Run and type in the truncated path, it will take you to the specified database, in case you need proof. Otherwise, paths with spaces require quotes around them so Windows can tell where the end of the path occurs.
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    163
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: file path truncating (Access 97)

    Thanks for the explanation Charlotte, I appreciate it.

Posting Permissions

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