| BernieP 2004-10-19, 3:58 pm |
| An odd question, but hopefully someone out there will be able to help.
I have a VB.NET application that access JET databases that is working fine.
My users now want to be able to change the location of the databases
(currently hard coded). In VB6 with ADO that was simple (I used to create the
connection objects, recordsets etc. manually). However, being clever (or so I
thought), I used the tools in Visual Studio to create my datasets, and as a
result am having significant dificulty in changing the connection.
I have found the Windows Forms Designer generated code that sets the
ConnectString Property in the InitializeComponent method of the form, I have
not yet tried retrieving the connection string from the registry at that
point, but that will require my user to restart the application if they
change the DB source (not a problem, but not what has happened previously). I
have tried changing the OLEDBDataConnection Object ConnectionString property
at the time the user changes it, but this does not seem to work. Do I need to
refresh the connection somehow?
All help appreciated, as usual...
Bernie Porter
|