Getting Multiple Primary key in VC++

  • Thread starter Thread starter A.R.Rethinam
  • Start date Start date
A

A.R.Rethinam

Hello,
I have a table(in MS ACCESS) with more than 2 primary keys. How to
retrieve this PKs through VC++ application. Any API or sample code
will be really helpful.

thanks,

Rethinam
 
Just a picky point on terminology. By definition, a table can only have 1
primary key. Do you mean your primary key has more than one field in it?

Not sure how to do it in C++, but in VBA, you'd use something like:

Sub ListPKFields(TableName As String)
Dim dbCurr As DAO.Database
Dim fldCurr As DAO.Field

Set dbCurr = CurrentDb()
For Each fldCurr In
dbCurr.TableDefs(TableName).Indexes("PrimaryKey").Fields
Debug.Print fldCurr.Name
Next fldCurr

End Sub
 
Thanks J.Steele for your information. Its working find in VBA, I want
to use in C++ application, Where we don't have this properties to
access the index...Can anyone have experience in getting multiple
indexes in C++ or any Database API's are available for the same.
Thanks for any sample code in c++ or any related web link is
really helful.

thanks
Rethinam.
 
Back
Top