Single VB.Net app using multiple Access mdb files with databinding

parkerjnc

Member
Joined
Oct 12, 2007
Messages
10
Programming Experience
3-5
I have a database driven app which uses an Access mdb file for the data source. Users can have multiple "projects" which are contained in their own mdb files. The app must allow the user to switch between "projects" and the data bindings in the interface must follow the active project. Any suggestions on the best way to handle?

I currently have a connection string defined in my app's properties which points to a specific "base" file name. This is the database file that is always initially loaded. When switching projects I save this file to another filename based on the current project's name and copy the new project's file to the "base" file name. Then I restart the app to reset the data bindings. It seems there should be a better way of doing this.

JR
 
er.. I cant say that I'd advocate separate mdbs in any situation.. one database is capable of holding multiple project records!

However.. the only reason you cannot change the connection string is because it is an application scope setting. There are a few threads on the forums here where I duscuss how to change the db on the fly.. have a search for "Application Scope connection string" and read the longest threads fully.. THere are a great many traps you can fall into, but its very easy if youre precise and not forgetful :)
 
Back
Top