Results 1 to 4 of 4

Thread: [RESOLVED] App Path

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    138

    Resolved [RESOLVED] App Path

    Hello!

    I have this code (it's not important for what)

    Code:
     Me.OleConnection.ConnectionString = "Data Source=""C:\Program Files\bin\Debug\base.mdb""; Jet OLEDB:Engine Type=5;" & "Provider=""Microsoft.Jet.OLEDB.4.0"";"
    And how to make app (relative) path? Database will be in the same directory with .exe application.

    Thanks!

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: App Path

    Code:
    Me.OleConnection.ConnectionString = "Data Source=" & Application.StartupPath() & "\base.mdb; Jet OLEDB:Engine Type=5;" & "Provider=""Microsoft.Jet.OLEDB.4.0"";"

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: App Path

    Just an FYI that the program files directory is NOT the place to store a database file.

    It won't work right in Vista or Windows 7, (or XP if you aren't an admin for that matter).

    The program files directory is readonly unless you have admin permissions.

    The proper place to store the database file would be in the users data folder, or the program data folder that is global to the system.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    138

    Re: App Path

    Thank you for replay.

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