Results 1 to 8 of 8

Thread: Q. about App.Path

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    42

    Question Q. about App.Path

    I am trying to use app.path to denote the location of a database.

    I am writing DataSource = App.Path + "file.mdb"

    but it instead of adding c:\folder\file.mdb

    it gives c:\folder\app.path\file.mdb

    What gives?

    Why is app.path added to the path??

    Thanks.

  2. #2
    VB Code:
    1. DataSource = App.Path & "\file.mdb"
    There was no backslash, and the + might have done something weird. Does the code help at all?

  3. #3
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by filburt1
    VB Code:
    1. DataSource = App.Path & "\file.mdb"
    There was no backslash, and the + might have done something weird. Does the code help at all?
    Not very likely but app.path could return "C:\", in which case that would blow up
    VB Code:
    1. Dim strAppPath as string
    2.  
    3. If right$(app.path,1) <> "\" Then
    4.     strapppath=app.path & "\"
    5. else
    6.     strapppath=app.path
    7. end if
    That way, it will always have a backslash at the end

  4. #4
    Originally posted by chrisjk
    Not very likely but app.path could return "C:\", in which case that would blow up
    Just to clarify, it doesn't have to be the C: drive; it could return "D:\", "X:\", etc.

    BTW, does App.Path work with UNC paths?

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by filburt1
    Just to clarify, it doesn't have to be the C: drive; it could return "D:\", "X:\", etc.
    I think you know what I meant!
    BTW, does App.Path work with UNC paths?
    Not on a network at the moment so can't find out. I should think so though

  6. #6
    Originally posted by chrisjk
    I think you know what I meant!
    I know , I was just making sure everybody else did.

  7. #7
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Originally posted by FNC
    I am trying to use app.path to denote the location of a database.

    I am writing DataSource = App.Path + "file.mdb"

    but it instead of adding c:\folder\file.mdb

    it gives c:\folder\app.path\file.mdb

    What gives?

    Why is app.path added to the path??

    Thanks.
    The only way you could have got that result is if you enclosed App.Path in double quotation marks, i.e. instead of writing App.Path if you wrote "App.Path".

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  8. #8

    Re: Well ...

    Originally posted by honeybee
    The only way you could have got that result is if you enclosed App.Path in double quotation marks, i.e. instead of writing App.Path if you wrote "App.Path".
    For example, you might have typed "App.Path file.mdb", where App.Path would not have been parsed.

Posting Permissions

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



Click Here to Expand Forum to Full Width