• file path truncating (Access 97)

    Author
    Topic
    #357543

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #531348

      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.

      • #531371

        Thanks for the explanation Charlotte, I appreciate it.

    Viewing 0 reply threads
    Reply To: file path truncating (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: