Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access Path Error on Installation using DAO data control

Status
Not open for further replies.

webcrazy

Instructor
Dec 24, 1999
14
US
Hi

I'm trying to make a Program with a Single Table Data base using Access 2000 and the DAO
data control in VISUAL BASIC 6 Enterprize Edition.

When I create the install using the package and deployment wizard,burn it on a cd
and install it on another PC it gives me a path error to the the Access data base
if I change the directory during the installation.

Is there a way to have My program connect to the Data base even if I change the
installation path ?

One person suggested to add the DAO Data control at RUN TIME but I don't know how to do this.
Any help is greatly appreciatecd.
 
You've hard-coded the installation directory path? Merely trap the error, use the 'Common Dialog Control' to provide a Windows user interface for browsing to the directory, and replacing the hard-coded value. Since this would occur each time the application were opened (Can't permanently change the properties while in run-time, you could either store the values in the registry, like I do, or store it in a table.

Steve King Growth follows a healthy professional curiosity
 
Thanks for the Help Steven I'll try this and let you know.

Web
 
What I normally do is make sure the database is stored in the same folder as the application and use the following:

Data1.DatabaseName = app.path & "\database.mdb"

This way, if your application's path is changed during setup, the database will always be found as long as it lives in the same folder as your application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top