You could look in the field Properties collection. Start by enumerating all the property name/value pairs to see what's in there. It varies by database.<BR><BR>For SQL Server you could try:<BR>bKey = oRS(0).Properites("KEYCOLUMN")<BR><BR>Hope it helps.
*Apparently* with Access you cannot get the info.<BR><BR>The ADO docs here<BR><BR>http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/dasdk/mdae2bvx.htm<BR><BR>say that ADODB.Field.Attributes will have the &H8000 bit (denoted as adFldKeyColumn) set if the column is the primary key. But I have been unsuccessful in trying to get any Access DB to return that value for any field designated as the primary key. I tried designating both an autonumber field and an ordinary text field as the primary key; neither would exhibit this bit in the Attributes value of the given field.<BR><BR>I hope and presume this bit works with other DBs.<BR><BR>