If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Compile a program

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 14,819
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.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old
Purveyor of Discontent
 
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? ***
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Aug 2004
Location: Dallas, Texas
Posts: 789
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.
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On