Solved

How to change the connectionstring during setup in VB.NET

Posted on 2004-03-24
2
404 Views
Last Modified: 2006-11-17
I am using an oleDbConnection to connect to a MS Access file (mydata.mdb) that uses Connectionstring ....Datasource="c:\data\mydata.mdb"...
I want to give the users ability to change this filepath during setup.
A filedialog box (or something) to browse to a fileshare for example g:\data and then the setup will install/copy the mydata.mdb to g:\data,
and change the datasource path to the same selected fileshare.

I have tested the Application Configuration File withe the following xlm code:
<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
  <appSettings>
    <add key="datasource" value="g:\data" />
      </appSettings>
</configuration>

Example of different installation cenarios:
One company will maybe use a local installation and the datasource value would be "c:\data" (default)
The next company will maybe use a client/server model and the datasource value should point to a datashare ("x:\common")
The next company will maybe use a client/server model and the datasource value should point to a datashare ("f:\dep_data")
and so on...

I want the user/company to select where to put the mydata.mdb during setup ( OR at first application startup )
(Not manually change the configuration file).
0
Comment
Question by:Bengtb
  • 2
2 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 500 total points
ID: 10667641
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 10676943
hi Bengtb,

what is wrong with the solution from the given link? Why grade C?

B..G
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

10 Experts available now in Live!

Get 1:1 Help Now