Ive been installing a VB application on another computer, but wen im running the program an error occurs it says that my database is not valid(the path).
my program has no app.path thats why i install it on Local disk D.
Wat should i do now?
is there any option on how can i run the program on another Local computers?
thanks.

Dani AI

Generated

The error that reports a path like "C:...Desktop\project\a.mdb" shows the application is using an absolute, design‑time path instead of resolving the database location at runtime. That explains why the app works on the developer PC but fails after installation. correctly identified the hard‑coded path; correctly pointed toward App.Path and using a configuration mechanism. The practical options below turn those ideas into concrete, deployable fixes.

If the database is deployed with the executable, build the connection string from the executable folder instead of a fixed path. In VB6, use App.Path and ensure a trailing backslash before concatenation:

Dim dbFile As String
dbFile = App.Path
If Right(dbFile, 1) <> "\" Then dbFile = dbFile & "\"
dbFile = dbFile & "MyDatabase.mdb"

Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFile & ";"
Conn.Open

For VB.NET the equivalent is Application.StartupPath. For newer Access formats use the ACE provider (e.g., Microsoft.ACE.OLEDB.12.0) if required.

If the DB must be configurable or writable, store its path in a configuration file or registry entry that the installer writes (as suggested). Do not place a writable database under Program Files on modern Windows (permission restrictions). Use a suitable location: per‑user data in AppData, common writable data in ProgramData, or a network share for multi‑user databases. For concurrent multi‑user scenarios, consider a server DB (SQL Server Express) instead of an Access file.

Deployment checklist: ensure the Jet/ACE provider exists on target machines; have the installer copy the DB to the chosen folder and write the final path into a config; test on a clean machine; and add logging or show the resolved connection string at startup for quick diagnosis.

Recommended Answers

All 4 Replies

Hi

my program has no app.path thats why i install it on Local disk D

Not sure what you mean by this, Vb6 does have an App.Path method, see the Code Changes to the App Object here for an example.

Also, I would recommend storing this type of information in a configuration file. In Vb6 this was usually done with good old ini files and using the GetPrivateProfileString and WritePrivateProfileString API calls. You can get an example from this article: .

HTH

i have the same problem as well, but after install the app says c://.../desktop/project/a.mdb path not available, i know that path is my own computer's path, how to change it to general?

Hi

i know that path is my own computer's path, how to change it to general?

The App.Path method will return the location to where your executable resides. If your database is in the same location as the executable then it should work fine. If however your database is located somewhere else then you will need a mechanism for managing this, such as a configuration file.

thanks djj,
yeah all the files and the database itself are at the same location, in my computer. but when i install it in another app then it shows my computer location and says path is not valid. now show me a way to install it in any computer and work there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.