Results 1 to 4 of 4

Thread: [RESOLVED] open file from the same directory the .exe is in

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    13

    Resolved [RESOLVED] open file from the same directory the .exe is in

    This is what I mean.

    I have a DATA control with the property "DatabasName" set to "c:\VB_prog\MyApp\mydatabase.mdb".

    The program will be installeble in a directory of user choice so how can I set the path to the same as the exe files in?

    I miss the ".\mydatabase.mdb" option

    Anyone has a solution to this?

    /Martin

    I tried to search but it's a strange search to do....

  2. #2
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: open file from the same directory the .exe is in

    your app directory is a constant refered to by:

    vb Code:
    1. dim mypath as string
    2. mypath= App.Path + "\"
    3. msgbox "your app is in " & mypath

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    13

    Re: open file from the same directory the .exe is in

    THANK ALOT!

    That did the trick....

    /Martin

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [RESOLVED] open file from the same directory the .exe is in

    Using the Data control is a bad idea, not only does it limit what you can do, but it is also "obsolete", so will not work on many computers.

    It would be much better to use ADO code instead - see the ADO Tutorial link in my signature for code which is the equivalent of a data control, but is much more flexible, and is well supported (so it will work on many more computers, and we can help you much more easily if you run into problems).

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