Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ClickOnce Deployment to include MS Access DB

Posted on 2009-04-11
6
Medium Priority
?
590 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Independent Software Vendors: 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!

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

963 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