none
Find Name of Database Linking to "This" Database?

    Question

  • Is there a way to find out the name of a database that has links to the currently opened database?

    I have a situation where a central client database links to several ancillary databases, but only the main client database contains client identifying info. So, if I open one of the ancillary databases, I have no idea which client it belongs to. Obviously, modifications have to be made to include some client identification info in the ancillary databases.

    But it got me wondering if there was a way for a database to "know" that some other database has links to it. Does anyone have a definitive answer for this?

    Thanks

    Tuesday, February 05, 2013 8:39 PM

Answers

  • Hum, if those other applications have the current database open, then this would be possible.

    So if you are running the application and OTHER applications (or users) are running copies of other Access applications that have table links to your application when in use = posssible.

    When not in use = not be possible.

    So in the case of the others having table links to your existing application, then you could perhaps example the locks file but ONLY IF the other front ends have the links open.

    However, if those other links are not active and running and in use and open? No, I am not aware of a possible way to determine what other applications are linked to the current application you have open.

    You can have 5 or 20 front ends link to a single database. The database has NO idea how many front ends or applications that have front ends linked to your application. Some of those applications might be sitting on a jump drive in someone's pocket. So, as a general rule EXTERNAL links to a given database cannot be determined since the linked database is not touched or modified in anyway.

    As noted, you can however examine CURRENTLY OPEN and Active connections since they make an entry in the locking file. So the key concept here is if you are talking about active (live open) links, or non active links.

    You cannot in any way know of the many front ends that could be linked to your current database but not currently  in use.

    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada 

    • Marked as answer by Marak60 Wednesday, February 06, 2013 3:11 PM
    Wednesday, February 06, 2013 12:37 AM

All replies

  • I am not sure I understand your needs.

    What version of Access?

    Is the db Split FE / BE?

    Are you in the BE trying to see which FE's are currently logged in?

    Are you using an older version of Access with Replication and are trying to see which replication is connected?


    Chris Ward

    Tuesday, February 05, 2013 8:55 PM
  • No, not a FE/BE situation.  The databases are both back end, but are split because some of the information is static and some of it is dynamic and portable.

    The central (static) database contains linked tables. They are linked to tables in the portable databases. Is there any data or meta-data in the portable databases that identifies the static database that links to them? (even if the link is currently not active).

    Ideally, I'd like to be able to open a "portable" database and retrieve the name of the static database that links to it.

    Thanks

    Tuesday, February 05, 2013 9:22 PM
  • No, not a FE/BE situation.  The databases are both back end, but are split because some of the information is static and some of it is dynamic and portable.

    The central (static) database contains linked tables. They are linked to tables in the portable databases. Is there any data or meta-data in the portable databases that identifies the static database that links to them? (even if the link is currently not active).

    Ideally, I'd like to be able to open a "portable" database and retrieve the name of the static database that links to it.

    Thanks

    Hi Marak60,

    If you know the location of the static database, then in principle you can read the TableDefs table of the static database from any portable database, and retrieve the the information of the links.

    Is this what you want?

    Imb.

    Tuesday, February 05, 2013 10:23 PM
  • The following query always gives you the currently connected file:

    SELECT DISTINCT MSysObjects.Database
    FROM MSysObjects
    WHERE (((MSysObjects.Type)=6));

    Tuesday, February 05, 2013 11:13 PM
  • No, I don't know the location of the static database.  Think of it as a one-way street. The static database knows where all the portables are, but not the other way around.

    When you link from one database to another, there's some underlying security-checking, handshaking, etc, so I'm thinking there must be something in the portable database that tells it to allow the link request from the static database. But I don't know where to find that info.

    Thanks for your your input.

    Tuesday, February 05, 2013 11:16 PM
  • Thanks Lawrence, but that didn't do the job either. The MSysObjects table in the static database contains records that refer to the portable databases, but not the other way around. There is nothing at all in the MSysObjects table in the portable database that points to the static database (even while the link is active and in use).

    I'm going to dig a little deeper into the Access system tables as that seems the most likely place to find information like this, if it exists at all.

    Thanks again.

    Tuesday, February 05, 2013 11:31 PM
  • Hum, if those other applications have the current database open, then this would be possible.

    So if you are running the application and OTHER applications (or users) are running copies of other Access applications that have table links to your application when in use = posssible.

    When not in use = not be possible.

    So in the case of the others having table links to your existing application, then you could perhaps example the locks file but ONLY IF the other front ends have the links open.

    However, if those other links are not active and running and in use and open? No, I am not aware of a possible way to determine what other applications are linked to the current application you have open.

    You can have 5 or 20 front ends link to a single database. The database has NO idea how many front ends or applications that have front ends linked to your application. Some of those applications might be sitting on a jump drive in someone's pocket. So, as a general rule EXTERNAL links to a given database cannot be determined since the linked database is not touched or modified in anyway.

    As noted, you can however examine CURRENTLY OPEN and Active connections since they make an entry in the locking file. So the key concept here is if you are talking about active (live open) links, or non active links.

    You cannot in any way know of the many front ends that could be linked to your current database but not currently  in use.

    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada 

    • Marked as answer by Marak60 Wednesday, February 06, 2013 3:11 PM
    Wednesday, February 06, 2013 12:37 AM
  • Hi Marak60

    "Marak60" schrieb im Newsbeitrag news:bd6d3cbf-adf6-438b-bc1b-3b2faeec7551@communitybridge.codeplex.com...

    No, I don't know the location of the static database.  Think of it as a
    one-way street. The static database knows where all the portables are,
    but not the other way around.

    As long as the other portable database isn't holding an active connection to the static database there is no chance to find where the database are.
    If they have a connection then you can find who (user) is linking it access
    http://access.mvps.org/access/modules/mdl0055.htm

    But there is no way to find what Access Database has links to other databases. The reason is simple. These links consists only of information about how to access the other table. You can also link other tables without having them linked in the TableDefs by directly using the link information in a Query for example.
    And when you link to a table the origin linker doesn't have to provide where and how he is linking the table. The only thing what happens is that Jet is writing to the .LDB file who has a link and what kind of link it is to maintain the locks to the database.

    What you want to do is not possible. The only thing you can do is read the .LDB file (explained in the above mentioned link) and there find the user/computer from where an active connection to one of your tables exists.

    Henry

    Wednesday, February 06, 2013 2:42 AM
  • Albert,

    Thanks for the info.

    Rgds,

    Mark

    Wednesday, February 06, 2013 3:12 PM