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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -