Get primary keys of an Access database lazarus / 16-Databases ---------------------------------------------------------------------- RayoGlauco · 2024-02-13 11:25 Hello, I am connecting to an Access database (.accdb file) using ODBC. I want to know what the primary key of a table is, but I can't find how to do it. It seems that SQLPrimaryKeys is not supported by MS-Access ODBC drivers and then UpdateIndexDefs is not working. Does anyone know how to get the primary key? Thank you ---------------------------------------------------------------------- Zvoni · 2024-02-13 11:40 Quote from: RayoGlauco on February 13, 2024, 12:25:20 pmHello, I am connecting to an Access database (.accdb file) using ODBC. I want to know what the primary key of a table is, but I can't find how to do it. It seems that SQLPrimaryKeys is not supported by MS-Access ODBC drivers and then UpdateIndexDefs is not working. Does anyone know how to get the primary key? Thank you Have you analyzed the FieldDefs? That said: AFAIK, Not possible with MS Access, since MS Access stores a Table's metadata in a binary blob inside a sys-table called "MSysObjects" ---------------------------------------------------------------------- RayoGlauco · 2024-02-13 14:21 If anyone is interested, I found a solution here: https://forum.lazarus.freepascal.org/index.php/topic,28702.msg179953.h tml#msg179953