Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Eliminating Duplicate Entries
Message
De
24/03/2003 14:28:23
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
 
À
24/03/2003 13:45:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00769364
Message ID:
00769385
Vues:
22
>Hi,
>
>I have a table that contains two fields. One is a unique id and the other is a company name. I also have a form that allows users to add company names to the table. Right now I have code that checks to see if the company has already been entered by comparing the value entered versus the table column for company name. However, this is not very effective. For example, the company name 'Turner Construction' could be in the table and the user enters 'The Turner Construction Company' or some derivative of this and it would not result in a match. Can someone please provide a suggestion on how to better handle this.

Ahh, users - gotta love 'em! I'd suggest fines and/or electric shocks.

Seriously, you have 2 main approaches - you can use either or both.

1. Pre-processing - before a user enters a "new" record, give them an opportunity to look up the entry they're about to make - e.g. a partial string search on "Turner" would probably "turn" it up, so they would know not to even bother entering the "new" entry in the first place.

2. Post-processing - after a user enters a "new" record, make partial string searches on all "meaningful" separate words in the "new" entry. If match(es) are found, display them so the user has a chance to choose an existing one (thereby automatically aborting the "new" entry) or, after confirmation, create the new entry as the user wants.

The second option gets tricky if the user makes spelling mistakes e.g. "Tuner Constructon" could be quite tricky to match to an already-existing record. You might need to look into the VFP SOUNDEX() function or a third-party alternative.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform