SCDN
SCDN

Reputation: 40

Vb.Net Application installer not updating access database

As the title says my vb.net application installer is not updating the correct database, the application works fine when debugging with visual studio, however when i install it the database in the data directory is not updated to the latest.

I use "Microsoft Visual Studio Installer Projects" to make an installer with all the needed files, this is how i have set it up:

Application Folder: Image

User Desktop: I have just a shortcut to the .exe in the application folder

User's Program Menu: I have a folder with the app name and inside that a shortcut to the .exe in the application folder

When installed into the computer the database is not the latest and i know this because when i try to use a button with an insert query the app gives back an error non being able to find a column, "ID_User", that i just recently added.

Database connection string:

Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Account.mdb")

More Info:

I used the visual studio deployment wizard to create the setup files instead of the Visual Studio project installer and the application works just fine so i assume its a problem just with the other installer and how its configured but i cant figure out whats the problem, i always used it and never had problems until the latest release.

Edit:

I tried adding the database inside the application folder in the Visual Studio project installer and setting the property of the database to always copy it inside the output directory, still no luck.

Upvotes: 0

Views: 172

Answers (1)

SCDN
SCDN

Reputation: 40

Solution:

I don't know either what happened but somehow i might have messed up something in the database while editing it, i made a new one with the same fields and replaced the old one, now everything works just fine.

Edit 08 Jan 2021: Same problem happened again, and this time i think i know why... i edited the database again but i didnt open the file directly but from Visual Studio solution explorer and then edited it. When i tried installing the new version it didnt work again and when i changed the database it started working again. So i think the problem is that the visual studio db editor doesn't save changes somehow.

Upvotes: 1

Related Questions