Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Listing foreign keys


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Sep 8, 2016 5:25 AM Last Post By: Trevor Cooper
Trevor Cooper

Posts: 45
Registered: 10/7/10
Listing foreign keys  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 6, 2016 10:57 PM
Hi,

I want to delete all foreign keys at runtime prior to making some schema changes and then re-imposing the cross-reference relations. I'm trying to work out how to get a list of foreign keys using FireDAC. The Access database doesn't respond to a TFDMetaInfoQuery. Is there another way?

Thanks for any advice

Trevor Cooper
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Listing foreign keys  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 2:05 AM   in response to: Trevor Cooper in response to: Trevor Cooper
Access ODBC driver does not support returning of foreign keys.
You can try to read MSysRelationships table directly.

--
With best regards,
Dmitry
Trevor Cooper

Posts: 45
Registered: 10/7/10
Re: Listing foreign keys  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 5:25 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
HI Dmitry,

Thanks for the advice. Unfortunately that approach produces the error message 'could not read definitions; no read definitions permission for table or query 'MSYSRELATIONSHIPS'.

So it looks as though I have to revert to DAO or ADOx to do this.

Regards

Trevor Cooper
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02