Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ClickOnce Deployment to include MS Access DB

Posted on 2009-04-11
6
583 Views
Last Modified: 2012-05-06
I am trying to create a setup for an app to be tested.
I have added a Setup project to my app.
I then added a new folder "User's Application Data Folder" to my setup project.
I also added the database to this folder by right clicking in the right pane and selecting Add > File.
In my program, it looks for the db in the
Users application Data Folder \our company\program name\database

How do I make sure that first the db is installed and then installed to the right path?

Thanks,
0
Comment
Question by:Sheritlw
  • 3
  • 3
6 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24124920
Hi Sheritlw,
Using a Setup Project is no CickOnce Deployment. They are two different deployment strategies and you can read more in here
 Choosing a Deployment Strategy  
http://msdn.microsoft.com/en-us/library/e2444w33(VS.80).aspx
About your question I didn't understood. You want to know the path for the connection string where the *.mdb is installed ? Why don't you place near the exe file ?
0
 

Author Comment

by:Sheritlw
ID: 24126809
Hi jpaulino,

I know I don't explain things very well, but I'm trying:-)
The program I have will be network ready, meaning that I have created a procedure that reads and write the registry.

Private Function GetDBPath() As String
        Dim dbPath As String

        Try

       
            Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey("Software\SMS\RacersAdvantage")
            If Not IsNothing(regKey) Then
                dbPath = regKey.GetValue("DBPath")
            Else

                dbPath = frmDBSelect.ReturnPath()

                If Not dbPath Is Nothing Then

                    Dim RegValue As RegistryKey = Registry.LocalMachine.CreateSubKey("Software\SMS\RacersAdvantage")

                    RegValue.SetValue("DBPath", dbPath)
                    RegValue.Close()
                    frmDBSelect.Close()

                End If
            End If
            regKey.Close()

            dbPath += "\RacersAdvantage.mdb"
        Catch ex As Exception
            MessageBox.Show("Cannot open database")
            End

        End Try


        Return dbPath

    End Function

With this procedure I am able to let the user specify the location of their db on a network.
I originally had the db completely separate and generated datasets etc from code.  Since having so many problems trying to add the db, I went ahead and added the db to the program, which generated all the dataset stuff, which I will not use.
After looking at a lot of stuff on-line, I went ahead and added the setup project so that I could modify the setup.
I added the user data folder and then folders to represent where the default install of the database would be.  I then added the database to that folder, but I kept getting strange messages.
 I normally would create a setup, using SetupFactory, where the user could pick if they want to install the database or not.
This program is for my sister, so I didn't want to spend the money to purchase the .Net version of Setup Factory, so I thought I would try and do a setup with the OneClick method.
Is what I want to do even possible?  If it is, is it a real pain?

ApplicationSettings.jpg
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 24127198
ClickOnce as some limitations but you can include the database or other files with it. It as some advantages, like easy update, but you need to decide what's better for your project.
Check this Comparison Table
http://msdn.microsoft.com/en-us/library/142dbbz4.aspx
 
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Sheritlw
ID: 24128627
Hi jpaulino,

I read all kinds of stuff on the clickonce technology.   WOW... I think it will take me a while to learn.
Still trying to figure out how to get setup to work....
Thanks for the link, even though I clicked on it and it crashed my IE:-)  Don't know why it crashes, but it sure is frustrating.

Sheri
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24128643
Do you have the latest IE (version 8) ? You can also try another browser like firefox or chrome
0
 

Author Comment

by:Sheritlw
ID: 24128654
No, I have 7... think I will update or change like you suggest.
Thanks again... you are great!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question