|
|
||||||
|
#1
|
|
|
|
|
I am new to .Net and working on my first program. I have created a Data
Source using the Data Source Configuration Wizard, and an Access database. However, when I distribute this app, I will not have control over where the database resides. How can I programmatically change the connection string in the data set created by the wizard? |
|
|
|
#2
|
|
|
|
|
On Mon, 4 Dec 2006 14:58:02 -0800, Vernon Peppers
<VernonPeppers> wrote: >I am new to .Net and working on my first program. I have created a Data >Source using the Data Source Configuration Wizard, and an Access database. >However, when I distribute this app, I will not have control over where the >database resides. How can I programmatically change the connection string in >the data set created by the wizard? Well, since you don't know where the user will have the database, you will need to have them tell you where it is. You can do this by using the OpenFileDialog to let them navigate to the file and choose it, but be aware that they may not know how to do that. The better way to do this is to add your database to the application's project and let the distribution package put the database file in a location that is always known to the application. Search the documentation for "deployment". That will get you started. If you don't understand what you find then you can zero in on the target by posting a less general question. Good luck with your project, Otis Mukinfus http://www.arltex.com [url down] |
|
#3
|
|
|
|
|
Will you at least know what network drive it's sitting on? If so, you could
put the network path in as the default \\servername\share\mydrive\mydata.mdb Otherwise, you're going to have to give them a dialog to go find the database. Then you can store the setting for the user in <Settings> and use it after that. The connection string is probably in your <Settings> area anyway. In VB2005, double-click on MyProject to bring up the project properties. Then click on the Settings tab. Are they there? If so, you can change them after the user selects a database. Robin S. --------------------------------------------- "Vernon Peppers" <VernonPeppers> wrote in message news:f7e7 [..] |
|
#4
|
|
|
|
|
Vernon,
The problem is that you don't tell what kind of database you use, in my idea you got mostly all Jet (access) database answers. However you can always change the connectionstring in your program for another one. [url down] I hope this helps, Cor "Vernon Peppers" <VernonPeppers> schreef in bericht news:888a [..] |
|
#5
|
|
|
|
|
On Thu, 7 Dec 2006 05:36:00 +0100, "Cor Ligthert [MVP]"
<notmyfirstname> wrote: >Vernon, >The problem is that you don't tell what kind of database you use, in my idea >you got mostly all Jet (access) database answers. > >However you can always change the connectionstring in your program for >another one. > >[..] > >I hope this helps, > >Cor > [snip] > It *IS* an Access database. Perhaps you missed the line where he said it was an Access database... Good luck with your project, Otis Mukinfus http://www.arltex.com [url down] |
|
|
| Similar Threads | |
| Excel - MS Query - changing location of Access data source Using Office 2003. Is there a way to use a macro to update query data source links when the path to the data source changes? I created a spreadsheet and use MS Query to get... |
|
| Pivot table: Changing location of Excel data source? I have some pivot tables that currently pull their data from another tab within the workbook. I want to separate the data worksheet from the report worksheets, thus the data... |
|
| Changing Default Location for Data Source We recently converted to Word 2003 and when I create a data source, the default location to save it is My Documents, My Data Source. We want our staff to use our network... |
|
| Chart Source Data Ranges Changing when Data Sheet updated from text file source. I have a simple Excel wb with 2 sheets. Sheet 1 is simple Line Charts. Sheet 2 is the data for these charts. The data comes from a text file via the 'Import External Data'... |
|
| Changing Query source location? I have set up an Excel worksheet so that it pulls data from an Access database when the user fills out two cells. When I distribute this worksheet, the location for... |
|
|
All times are GMT. The time now is 03:44 AM. | Privacy Policy
|