How to get primary key of the table

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jaska45
Posts: 28
Joined: Fri 23 Dec 2005 03:55

How to get primary key of the table

Post by jaska45 » Fri 23 Dec 2005 06:19

I want to get the field names that belong to the primary key. How to do that?

Best regards,
Jaakko

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 23 Dec 2005 10:49

Use TMSMetaData to perform this operation.

jaska45
Posts: 28
Joined: Fri 23 Dec 2005 03:55

Post by jaska45 » Fri 23 Dec 2005 15:57

Thank for the repy.

However I could not find any property or method in TMSMetadata that could give me the primary keys. Can you tell me the name if the property/method please?

Best regards,
Jaakkko

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 26 Dec 2005 10:49

Set ObjectType to otPrimaryKeys and fill TableName.

Post Reply