Solved

ClickOnce Deployment to include MS Access DB

Posted on 2009-04-11
6
584 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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