John wrote:
Hi
I have a single front end to which I would like to select one of two
backbends at start-up. How can I accomplish this via code? Also is it
possible to leave the "active" backend to last used at next start-up unless
user wants to change?
Thanks
Regards
Firstly, what backend? Access, SQL, ???
There are a few ways to do it.
In one project I created a standard menu where the user could go
File/Open and select the backend they wished to open (I made up a file
extension and all my Access backend files used that).
In another I created a switchboard form which contained a drop down
which listed different backends they could attach to. This info was
stored in a table in the frontend. We used a decription and a number.
The data files (back ends) had the number in their name (eg.
XYZ0001.mdb). After the user selected a backend some code would
reattach all the table to that backend. We chose to have a frontend
table that contained a list of all the tables that were attached. We'd
loop through the names and refresh the linked table based on the new
backend. You can do the reattaching a few different ways though.
When you have SQL backends you can setup different DSNs for each and
then use a command-line parameter to pass the DSN you want to use in a
shortcut. On loading the database checks to see if the tables need
re-attaching and does so if required.
Hope that gives you some starting ideas.
regards,
Br@dley