Results 1 to 4 of 4

Thread: Two Primary Keys

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Please clarify.

    You have two uniquekeys or you have a primary key that is made up from 2 fields?

  2. #2
    Member
    Join Date
    Jun 1999
    Posts
    44

    Post

    Hi!,

    I am trying to search a Access 97 database using 2 primary keys but I have no idea how to use 2 primary keys to search Access. 1 yes, 2 no. Can anyone help point me in the right direction? Thanks!!

    Lloyd

  3. #3
    New Member
    Join Date
    Jul 1999
    Location
    New York
    Posts
    1

    Post

    First of all, why would you need 2 primarykeys in a table. Secondly if both of them are primary or rather unique key, you just have to search for one. If you are talking about a primarykey made up of 2 fields, then the code is simple.

    dim tbl as database
    dim rst as recordset

    set tbl = THEDATABASEFILE/LOCATION
    set rst = tbl.opendatabase("THETABLENAME", dbopentable)

    rst.index = "primarykey"
    rst.seek "=", FIELD1, FIELD2
    if rst.nomatch ...
    bla..bla...


  4. #4
    Member
    Join Date
    Jun 1999
    Posts
    44

    Post

    Thanks!! I got it working (well half way but I think I can handle it from here.)

    Thanks for the help!!

    Lloyd

Posting Permissions

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



Click Here to Expand Forum to Full Width