Click here to Skip to main content
15,901,853 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\solutionvs10\test\test\bin\Debug\db2.mdb;Jet OLEDB:Database Password=secret")

cn.Open()
// codes
cn.Close()

I used VS 2010
Above is my code - one can see that it is Ms Access DataBase.

How can I create a setup that can beeasy to install on other computer?
Posted
Updated 17-Nov-10 4:01am
v2
Comments
Kschuler 17-Nov-10 11:01am    
Are all installations of the program supposed to use their own database or do they all connect to the same one in some shared location?
Neeil 17-Nov-10 23:03pm    
i have only one datanbase...it is small project......please give me solution....steps.

1 solution

What is the problem exactly?
is it the connection string, or a creating a setup program?

if you want to create a setup program have a look at InnoSetup, it's a cool tool, powerful and free.

If your problem is about the connection string, if your database is stored in the program folder you could do something like that:

<br />
Imports System.Reflection<br />
<br />
Dim path as String = System.Reflection.Assembly.GetExecutingAssembly.Location<br />
<br />
Dim connectionString as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + path + "db2.mdb;Jet OLEDB:Database Password=secret"<br />
<br />
cn = New OleDbConnection(connectionString)<br />
cn.Open()<br />
// codes<br />
cn.Close()<br />


If your database is store somewhere else you could store the path in the registry or an xml file or an ini file etc...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900