I don't know whether you are using DAO or ADO but one method is to use ADOX (Microsoft ADO Ext 2.x for DDL and Security):
OpenSchema would be another option.
Dim catADOX As New ADOX.Catalog
catADOX.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Test Files\db1 XP.mdb;"
For Each keyADOX In catADOX.Tables("Table1").Keys
If keyADOX.type = adKeyPrimary Then
Set catADOX = Nothing
Set keyADOX = Nothing
Personally I can't recommend using ODBC with a Jet database since it's not as stable as Jet OLEDB and is lacking in features.
Microsoft MVP (Visual Basic)