Switching FE between two BEs in Code

  • Thread starter Thread starter Pete
  • Start date Start date
P

Pete

How can one switch the default database in the Front-End code and allow
the user to connect between two or more Back-End databases?

The FE code uses CurrentDB to work with the individual tables. For
example "CurrentDB.tableDEFs".
 
Thanks for the pointer. I already have some code to relink. However,
I need to allow a switch sometime after the user hase started to work
and decides they need to switch. I assume that I could make sure that
all forms are closed and that their are no connectiions. The issue the
relink.

Does this sound correct?
 
Yeah, that sounds right.

I've included the ability to change back-ends in several of my applications,
and have never heard of anyone having problems using that capability.
 
You can do it simply by renaming the first BE something else and then
renaming the second BE with the same name as the original first BE presuming
the table names are the same in both BEs.
 
PC Datasheet said:
You can do it simply by renaming the first BE something else and then
renaming the second BE with the same name as the original first BE presuming
the table names are the same in both BEs.

This is an answer that is simply too simple ...
You have to be darn sure that the table *structure* is the same also, all the fields, indexes and such.
I would *never* rely on attaching like the way proposed... Relinking or refreshing the links is way better.
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1100 users have come to me from the newsgroups requesting help
(e-mail address removed)

--
To Steve:
Over 325 users from the newsgroups have visited the website to read what kind of a 'resource' you are...

To the original poster:

Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html (updated)

Arno R
 
Pete,

Arno is just a jerk!!!

Renaming the BEs will work fine. If the tables and fields were not the same
in both BEs, you would see error messages using the FE when you switched BEs
where the tables and fields were not the same.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1100 users have come to me from the newsgroups requesting help
(e-mail address removed)



PC Datasheet said:
You can do it simply by renaming the first BE something else and then
renaming the second BE with the same name as the original first BE
presuming
the table names are the same in both BEs.

This is an answer that is simply too simple ...
You have to be darn sure that the table *structure* is the same also, all
the fields, indexes and such.
I would *never* rely on attaching like the way proposed... Relinking or
refreshing the links is way better.
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1100 users have come to me from the newsgroups requesting help
(e-mail address removed)

--
To Steve:
Over 325 users from the newsgroups have visited the website to read what
kind of a 'resource' you are...

To the original poster:

Most people here have a common belief that the newsgroups are for *free
exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell
his services.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html (updated)

Arno R
 
Renaming is not the issue. I know I can shut down the app and relink
the tables.

I need to relink on the fly. I have code that will affect the relink.
What I need to do is terminate all forms and table connections to the
currentdb, relink, and restart the current app by starting one form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top