Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

External databases

Question posted by: rcollins (Familiar Sight) on May 14th, 2008 06:57 PM
I have probably about 30 databases. Each of these have their own front end. Different users have different databases they use. I want to make up a front end for each department so they can access the databases they need. I know this can be done by hyperlinks to open the individual databases, but I woul drather be able to do this within the front end databse for each department. Is this possible?
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
nico5038's Avatar
nico5038
Moderator
1,993 Posts
May 14th, 2008
07:07 PM
#2

Re: External databases
In general we do this using linked tables.
When your users just need to switch between whole databases, then you could look into using code for setting the current database to another .mdb. For this check the helpfile on the subject of WorkSpaces.

Nic;o)

Reply
rcollins's Avatar
rcollins
Familiar Sight
174 Posts
May 14th, 2008
07:51 PM
#3

Re: External databases
We already have the tables linked throughout the 30+ databases. Let me try to be a bit more specific. We have triage.mdb, officesupplies.mdb, mailinglables.mdb, cmdatabase.mdb which all have thier own front ends. I want reception to be able to access all four of these through a single front end. My hopes for this is that, because some departments can use up to 10 of the databases, that they dont have mdb icons all over the place, they can open the one and access all of the info they need.

Reply
nico5038's Avatar
nico5038
Moderator
1,993 Posts
May 14th, 2008
08:04 PM
#4

Re: External databases
There's no limit to link tables to different .mdb's.
Thus one front end can be linked to the tables of all back end databases.
It's the needed functions/forms that should be giving the guideline which tables should be linked.
Personally I did create multiple front-ends based on the same back end, but the other way around is no problem either.

Nic;o)

Reply
ADezii's Avatar
ADezii
Expert
3,697 Posts
May 15th, 2008
02:34 AM
#5

Re: External databases
Quote:
Originally Posted by rcollins
We already have the tables linked throughout the 30+ databases. Let me try to be a bit more specific. We have triage.mdb, officesupplies.mdb, mailinglables.mdb, cmdatabase.mdb which all have thier own front ends. I want reception to be able to access all four of these through a single front end. My hopes for this is that, because some departments can use up to 10 of the databases, that they dont have mdb icons all over the place, they can open the one and access all of the info they need.

You can use the OpenCurrentDatabase() Method to open any existing, External, Microsoft Access database (.mdb) as the Current Database via Automation. The following code will Open the Sample Northwind Database from whatever Database you are actively in. Northwind will then be treated as the Current Database.
  1. Declare at the Modular, not Procedural, Level:
    Code: ( text )
    1. Dim appAccess As Access.Application
  2. Run similar code to open Northwind.mdb as the Current Database.
    Code: ( text )
    1. 'Initialize string to External Database Path.
    2. Const conPATH_TO_EXTERNAL_DB = "C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb"
    3.  
    4. 'Create new instance of Microsoft Access.
    5. Set appAccess = CreateObject("Access.Application")
    6.    
    7. 'Open database in Microsoft Access window.
    8. appAccess.OpenCurrentDatabase conPATH_TO_EXTERNAL_DB

Reply
rcollins's Avatar
rcollins
Familiar Sight
174 Posts
May 15th, 2008
01:45 PM
#6

Re: External databases
So can I put this code under On_Click for a button? Or where would I use it to open the other database. When I put it with the button, it doesn't error but it doesn't open either. I put in my path R:\MDS_DBs\Misc\UIs\MailingLabel.mdb

Reply
rcollins's Avatar
rcollins
Familiar Sight
174 Posts
May 15th, 2008
01:55 PM
#7

Re: External databases
While looking I noticed that I do have a .ldb file, but the database is not open anywhere and it will not let me delete it, says the database is in use and it won't let me in the database either

Reply
ADezii's Avatar
ADezii
Expert
3,697 Posts
May 16th, 2008
03:00 AM
#8

Re: External databases
Quote:
Originally Posted by rcollins
While looking I noticed that I do have a .ldb file, but the database is not open anywhere and it will not let me delete it, says the database is in use and it won't let me in the database either

A Reboot should eliminate the .ldb File.

Reply
rcollins's Avatar
rcollins
Familiar Sight
174 Posts
May 16th, 2008
01:30 PM
#9

Re: External databases
So after looking at the individual databases I learned that there must be a form set to open when the database opens. I set this in each of them now they work. This will be great, thank you for your help with this issue

Reply
ADezii's Avatar
ADezii
Expert
3,697 Posts
May 17th, 2008
12:02 AM
#10

Re: External databases
Quote:
Originally Posted by rcollins
So after looking at the individual databases I learned that there must be a form set to open when the database opens. I set this in each of them now they work. This will be great, thank you for your help with this issue

You are quite welcome.

Reply
Reply
Not the answer you were looking for? Post your question . . .
178,100 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Microsoft Access / VBA Forum Contributors