duplicate records in access

Discussion in 'AutoCAD' started by sdanis, Apr 13, 2004.

  1. sdanis

    sdanis Guest

    I'm writing an application to extract attribute values from an AutoCAD dwg and placing them in an Access database.
    My question is this:
    How can I check a specific filed in the data base for duplicate records using VBA?
     
    sdanis, Apr 13, 2004
    #1
  2. sdanis

    thenrich Guest

    Select * from AutoCADObject = 'CurrentObject'

    Check the recordset to see if there are any records if there is then you have a match
     
    thenrich, Apr 13, 2004
    #2
  3. sdanis

    Luis Alberto Guest

    You have two ways:

    1) Make an SqlQuery: Select * From MyAccessTable Where MyField =
    'MyEntityAttribute' where the field and the entity attribute contain the
    duplicate values. If the recordset has records (MyRecordset.RecordCount > 0)
    then the value exists, so you are with an duplicated value.

    2) Make the Access field a KeyField so it can not contain duplicate values
    so if you try inserting an duplicated value an error results (this would be
    the worst way, but it also works).

    and placing them in an Access database.
    using VBA?
     
    Luis Alberto, Apr 14, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.