Getting Multiple Primary key in VC++

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
 
D

Douglas J. Steele

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
 
A

A.R.Rethinam

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top