简体   繁体   中英

how to define where my MDB database is stored in local hard disk (VB.NET)

VB.net seem to place my database file into /userprofile/local settings/apps/2.0/data/random/random/appname/data/ folder.

Can I define easier location for my published app. I am also worried that when upgrading this database is ignored or something bad happens?

Can I define easier location for my published app.

Well inside of your connection string you can specify the location of the database under Data Source.

Take your database and move it where ever you want, and then update the Data Source inside of your connection string to point to that path. You might have to play with it a few times to get the path right, but this should do what you are wanting to do.

VB.net seem to place my database file into /userprofile/local settings/apps/2.0/data/random/random/appname/data/ folder.

If you are making an installer then you will want to keep the database close to the application, most likely inside a sub-folder in the application's directory (like the data folder). That is why VS (not VB .Net) tends to place a created database inside of the data folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM