Link to home
Start Free TrialLog in
Avatar of AtifAqeel
AtifAqeel

asked on

Open Schema Primary Key

Hi

I am trying to know the primary key( I mean "PK" not "Required" ) of a table. In VB, Connection's OpenSchema(adOpenPrimaryKey) works fine with SQL Server and Oracle i.e. returns only those fields in the database which are Primary Keys in their respective Tables but when i use this function with MS Access it returns some binary values which are not understandable.
I need to know the primary key of a Table in MS Access on the fly using Visual Basic. Optional(The Schema should be returned as a Recordset as it is for SQL Server and Oracle)
On the web, i found a way through DAO's Table.Field.Index property, But i am using ADO 2.6.

I repeate again:
How to know the primary key of a table in MS Access on the fly using Visual Basic-ADO 2.6 ?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did this work for you?

/gustav
Avatar of AtifAqeel
AtifAqeel

ASKER

yes it did