c# - VB.NET with MS access Database as backend how to deploy by putting Database file to AppData Folder? -


i have developed vb.net application using ms access db backend, @ development , testing have been using connection string

 dim connect_string string = "provider=microsoft.ace.oledb.12.0;data source=" & application.startuppath & "\data.accdb" 

as deployment client's machines, database must outside of program files, how deploy application separating database program files. ?

you use

environment.getfolderpath(environment.specialfolder.xxxx) 

to find suitable root directory, , add yourcompanyname\yourapplicationname it. xxxx, use either applicationdata, or localapplicationdata, or commonapplicationdata, depending on requirements (see here). or let user configure local or network path, example in config file.

how "initial database" gets there program. example, test if @ there database file @ desired place , copy empty template mdb folder if there none. template db either in program's installation directory, or embedded resources of exe files, or create "on-the-fly" using dao or ado (do not know if that's possible ado.net).


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -