Solved

ClickOnce Deployment to include MS Access DB

Posted on 2009-04-11
6
582 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I need help embedding an image as HTML in my vb.net application 3 68
Help with Query not working in client's PC 1 36
VB.net and sql server 4 35
vb.net 1 month apart 11 29
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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 …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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