Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2012
    Posts
    12

    Thumbs down Compile a program

    Hi VB Gurus, I have compiled a simple program which includes an access file to store data. When I install the program on a different computer, VB cannot locate the access file. It complains of wrong path. Please, help me out.

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    970
    Silly question, given that I've only coded in VBA and Lotus Script, but is the problem file loaded onto the new PC? If so, is it loaded into the same directory structure?
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    14,914
    Which version of VB? Are you using a default store path (an environment variable or a registry setting) that isn't on the destination machine? Are you CERTAIN that the file exists, has the proper filename, and the correct path? What error message are you getting that makes you think that it can't find the file?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #4
    Join Date
    Apr 2012
    Posts
    12
    Hi pat Phelan, Thanks for your response. I am using VB 6.0. There is an ado Object on my Form. I used the ConnectionString to link the VB to Access. The issue is that by using the connection string, the computer sets the path automatically which I cannot change.

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Read your connection string from a configuration file and/or create a mechanism for changing it at runtime.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Aug 2004
    Location
    Dallas, Texas
    Posts
    793
    Quote Originally Posted by Asadi View Post
    Hi VB Gurus, I have compiled a simple program which includes an access file to store data. When I install the program on a different computer, VB cannot locate the access file. It complains of wrong path. Please, help me out.
    UNC is your path. \\servername\path...

    Can't use local drive letters.

  7. #7
    Join Date
    Oct 2011
    Location
    KENYA, KISUMU
    Posts
    2
    Quote Originally Posted by Asadi View Post
    Hi pat Phelan, Thanks for your response. I am using VB 6.0. There is an ado Object on my Form. I used the ConnectionString to link the VB to Access. The issue is that by using the connection string, the computer sets the path automatically which I cannot change.
    I tried this procedure. I dont think u need to include the application path. that is the path where your database is stored otherwise if you change the computer it wont detect the path. U should learn how to use app.path statement. I normally use ado recordset and I usu. likes using sgl statements to execute my tasks at hand.....If need the codes I can provide so that you problems can be sorted once and for all.

Posting Permissions

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