[This is preliminary documentation and subject to change.]
The MsiDatabaseGetPrimaryKeys function returns a record containing the names of all the primary key columns.
UINT MsiDatabaseGetPrimaryKeys(
MSIHANDLE hDatabase, // database handle
LPCTSTR szTableName, // name of table
MSIHANDLE *phRecord // handle for record
);
The field count of the returned record is the count of primary key columns returned by the MsiDatabaseGetPrimaryKeys function. The returned record contains the table name in Field (0) and the column names that make up the primary key names in succeeding fields. These primary key names correspond to the column numbers for the fields.
This function cannot be used with the _Tables table or the _Columns table.
Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in msiquery.h.
Import Library: Use msi.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Database Access Reference, General Database Access Functions