Solved

ClickOnce Deployment to include MS Access DB

Posted on 2009-04-11
6
579 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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 …
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now