closing a backend database (1 Viewer)

jimdan

New member
Local time
Today, 13:05
Joined
Jun 12, 2007
Messages
6
I have a front end and back end database

I have broken the links between the 2 databases



how can I close the backend database using VB from code in the front end database?

I keep getting errors that the DB is not exclusive
 

dcobau

Registered User.
Local time
Tomorrow, 03:05
Joined
Mar 1, 2004
Messages
124
Maybe I misunderstood your message. Why do you want to close the BE? Linking a table does not mean that you opened the BE, it just means that you have access to its data. What are you actually trying to do?

Dave
 

boblarson

Smeghead
Local time
Today, 10:05
Joined
Jan 12, 2001
Messages
32,059
Linking a table does not mean that you opened the BE, it just means that you have access to its data.
Not exactly correct - When you open a frontend that is linked to a backend file, it actually does open the backend database (and if you look in with the BE mdb file you'll see an ldb file that shows someone has the database open). So, if you are going to make any design changes to the Backend, you need to have everyone out of it before you can save design changes (it will allow you to save if you are adding a new table that isn't linked yet).

So the question is how to get everyone out of the database first so you can work on it. There are some posts here (unfortunately I have to go soon so I can't go look for them) that tell how to automatically kick everyone out.
 

RuralGuy

AWF VIP
Local time
Today, 11:05
Joined
Jul 2, 2005
Messages
13,825
Not exactly correct - When you open a frontend that is linked to a backend file, it actually does open the backend database (and if you look in with the BE mdb file you'll see an ldb file that shows someone has the database open).
You may wish to verify this assertion Bob. I believe you only open the BackEnd if you load a bound form or otherwise open one of the tables in the BackEnd. Otherwise the persistant connections recommended by Tony Toews makes no sense. I tested my theory on one of my systems to verify the results. Your friend.
 

dcobau

Registered User.
Local time
Tomorrow, 03:05
Joined
Mar 1, 2004
Messages
124
What I meant to convey to jimdan is that a BE is not opened like the FE and therefore does not need to be closed.

Hoping I am not making things worse.....

Dave
 

boblarson

Smeghead
Local time
Today, 10:05
Joined
Jan 12, 2001
Messages
32,059
You may wish to verify this assertion Bob. I believe you only open the BackEnd if you load a bound form or otherwise open one of the tables in the BackEnd. Otherwise the persistant connections recommended by Tony Toews makes no sense. I tested my theory on one of my systems to verify the results. Your friend.

Okay, technically that may be true, but from a practical standpoint I would think that a majority of users are opening a front end with a bound form being available when they open and when they use it. So, essentially, they will open the backend when they open their front end. Unless you completely use unbound forms (which some here on the forum have said they do) or not prepopulated combo boxes, list boxes, etc., then you would not have many times in which you do not have the backend opened.
 

jimdan

New member
Local time
Today, 13:05
Joined
Jun 12, 2007
Messages
6
now working

thanks for all the help.
I figured out why the backend DB was open. The switchboard was located in the BE database. I moved it to the front end and now I can close the BE when I unlink all the tables.
 

RuralGuy

AWF VIP
Local time
Today, 11:05
Joined
Jul 2, 2005
Messages
13,825
JUst for the record, there should be NO other code in the BE. The only objects in the BE should be the tables. It should also not be necessary to "unlink" the tables.
 

jimdan

New member
Local time
Today, 13:05
Joined
Jun 12, 2007
Messages
6
will try

I will try and not unlink and do the compress to see what happens, now that the switchboard has been moved to the FE DB

thanks for the help
 

jimdan

New member
Local time
Today, 13:05
Joined
Jun 12, 2007
Messages
6
it works

I commented out the delete and make links and it compresses.

thanks for the help
 

Users who are viewing this thread

Top Bottom