Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    United Kingdom, HERTFORDSHIRE
    Posts
    1

    Red face Unanswered: DAO - Finding the Index\Primary Field?

    Hi there, im using VB6 with Data Access Objects connecting to an Access 2000 database.

    I would like to find what the index\primary key is from the database using the DAO, but cannot find a method or property with the RecordSet object to do so.

    Any help much appreciated

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251

    Re: DAO - Finding the Index\Primary Field?

    in MS Access you can use

    For i = 0 To CurrentDb.TableDefs('mytable').Indexes.Count - 1
    Debug.Print CurrentDb.TableDefs('mytable').Indexes(i).Name & " : "; CurrentDb.TableDefs('mytable').Indexes(i).Primary
    Next


    if you use VB, you have to call DAO... it has the same property, there are few samples in DAO help...



    jiri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •