If you use the ODBC API directly, you can use the SQLForeignKeys API to do this . However, since you are using OdbcConnection objects, it would be a painful process to use the API for this one task. Well, for that matter, using the ODBC API directly for anything is a lot of work.
Edit I suggested the option to use OdbcConnectionGetSchema with 'ForeignKeys' as the name of the collection. However, I studied this and, unfortunately, OdbcConnection does not seem to support this collection.
Thus, in addition to using SQLForeignKeys directly (or for database-specific calls), it seems that ODBC is not going to provide a simple route for collecting this information in general. If someone can give an answer with a good mechanism for this, I will delete this answer, since its only value at the moment is to indicate that I do not know how to find the information in a clean way.
source share