Google Answers Logo
View Question
 
Q: Access Table ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Access Table
Category: Computers > Programming
Asked by: bselltiz-ga
List Price: $20.00
Posted: 24 Feb 2004 14:56 PST
Expires: 25 Mar 2004 14:56 PST
Question ID: 310438
I need to determine, using code,  if a table in any given database is
linked or native to that database.
Is this possible?

Request for Question Clarification by maniac-ga on 24 Feb 2004 17:47 PST
Hello Bselltiz,

To get an accurate answer to your question, please indicate which data
base management system you are using. Also, the term "link" may be
defined differently in various DBMS's and will affect the answer
provided.

There are certainly tools to do this kind of check. For example, with
Microsoft Access, there is a product like
  http://accessadvisor.net/doc/13575
which checks for link integrity and allows you to fix the broken links.

  --Maniac

Clarification of Question by bselltiz-ga on 24 Feb 2004 19:41 PST
Sorry to not be more specific.

I'm working in Access Xp and this code will be run on an .mde under
the access runtime.

I am currently managing all of the linking and unlinking right now
through my own code. The scenario I need to account for is the
following. The links exist to the target backend database in my mde.
Then say someone moves the back end database. The mde's links are no
longer valid. The only way I know how to delete links is if I know the
location of the backend database as it is stored in the link and to
also have the database actually be in that location.

I could of course keep a manual list of all the linked table names and
just work my code off that, but that is too hard to keep control over
in my environment. What I would really like is to obtain a list, in
code on the fly, of all tables in the current mde and then be able to
determine from a properties collection (or something similar) whether
or not the said tables are linked or are local to the mde.

Hope this helps.
Answer  
Subject: Re: Access Table
Answered By: hammer-ga on 25 Feb 2004 06:46 PST
Rated:5 out of 5 stars
 
Hi Brian,

There are several articles at the MVPS Access Web that will help you.
They include subroutines for relinking tables in code, listing linked
tables, checking to see if tables are linked or local, checking to see
if a table exists in the remote database, etc.

Relink Access tables from code
This topic includes a set of very handy functions and subroutines.
http://www.mvps.org/access/tables/tbl0009.htm

Retrieve linked database namepath
http://www.mvps.org/access/tables/tbl0007.htm

Relink tables from different datasources
http://www.mvps.org/access/tables/tbl0012.htm

Dev Ashish writes excellent code. I'm sure that these routines will
get it done for you.

- Hammer
bselltiz-ga rated this answer:5 out of 5 stars
Hey Hammer,
Looks like the second example is what I am looking for. I won't be
sure until next week as I have to leave on an unexpected trip and
won't be back until next Wednesday. None the less, thank you very much
for the answer, glad to see you're still working the board. :->

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy