For an application written in C# using an Access database via a JET OLEDB connection:
I am writing an interface that allows the user to edit the values of tables containing keywords (there are several tables involved, I’m trying to do it generically).
The tables contain several columns. Some columns have a “no duplicates” constraint, some do not. I need to be able to tell which columns have the “no duplicates” constraint so I can check the entries as a whole prior to writing them to the table, to avoid violating the “no duplicates” constraint. (I know I can catch the error when writing but I’d really prefer not to go there.)
How do I determine what columns in a table in an Access database have a unique (no duplicates) constraint?
Thank you
-Zhi
You can check the index schema for True in the Unique column. Some very rough notes: