Link to home
Start Free TrialLog in
Avatar of tyrron
tyrron

asked on

A problem with duplicate records

I'm having some problems with an app I'm making.

It collects data from a text-file, but I'm dependent on having unique values. Unfortunatly the text-file I'm grabbing data from, has a few duplicate entries and this is causing a problem when using this code where tbl_data_unique is Primary Key:

dtagames.Recordset.AddNew
   
dtagames.Recordset!tbl_data_unique= ldata(0)
               
dtagames.Recordset!tbl_data_name = ldata(1)

It's possible to remove the primary-key and remove duplicate records afterwards, but my preferred solution would be to have some error handling, skipping the recordset-creation if the fieldvalue already exists (As I'm getting an error message, it should be possible to trap this message and move on, shouldn't it?).
If this is not possible however, I would like to get some advice on removing duplicate entries in my table efficiently.

Thank you for your time...

EDIT: Sorry for posting this in the wrong section. Visual Basic -> VB DB would be more appropriate.

Tyrron
ASKER CERTIFIED SOLUTION
Avatar of Sethi
Sethi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tyrron
tyrron

ASKER

That was easy :)

Thanks!