Deploying an Application with database

Developer

Active member
Joined
May 30, 2007
Messages
29
Programming Experience
Beginner
Hi,

Just so you all know I have searched the net and could not find anything.

If you have a access database in your bin\debug folder that you placed your database in when developing. How do you deploy the database with your application and have it all work as when you were develping it.

I have tried right clicking and selecting include in project and so on but no luck getting my application to read from the database? Thanks in advance.
 
Someone please help, I see all these other applications that implement an Access database that installs to a specific location for their application to use. Someone on here must know how it's done, if someone with experience in this field could shed some light on the subject that would be awesome.
 
Hi,
I think all you have to do is to set the DataSource path in your connection string to your access (*.mdb) file. For example, if this is your connection string "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb;Persist Security Info=False" then during deployment make sure that your *.mdb file is in c:\. Or you may copy your *.mdb file to any location during installation and specify that path in your connection string data source. Hope this helps you.
 
Hey Ajeeshco,

That would work if I installed the application and the database separately for each install I do. Is there a way to publish the application so that the setup.exe created installs the copy of the mdb database with the application.


Thanks.
 
No. You can use a single setup for both *.mdb file and your application executables. The setup will copy all your files including the *.mdb file to the specified directory.
 
Back
Top