Db Schema in MFC app
0 answers - 822 bytes -

Is it possible to display a database schema in my MFC application? I'm using the ODBC API functions SQLTables and SQLColumns to dynamically display the database tables and the table attributes. However I would also like to display the relations (one-to-one, one-to many) between the tables in a similar way it is done in Access by pressing the Relationships button. In order to figure out the relationships between the tables in a database I would need to know the primary key for each table in the database. I thought about using the ODBC API function SQLPrimaryKeys to dynamically get the primary key for each table. However this function is not supported by most database drivers, including the access driver. Is there another way I can display the relationships between the tables in a database in my application?