Is that a spell check for someone writing a novel in your application, or is it for some technical entries? If you would explain it in more details you would get a better answer.
If, for example, you need users to enter only some hard to spell words, why not use a combo box with those words to choose from?
I have a list of 120 company names and they will be in a pic list going forward. Its the 100,000 + existing records where the company name was entered into a free form text box. These names have typos, misspelling, etc. I'm hoping to use the 120 names in a spellcheck function to correct the 100,000+ company names.
The 120 company names should be in a table where they would be 'spelled' once, right or wrong, and users can only choose the name from the list or combo. All other places (read: tables) where you need to use any Company, should use CompanyID instead which will connect to Company table by such CampanyID.
You may help your users to pick the Company by another combo like:
Display all Companies that start with a letter: (combo from A to Z)
and this 'letter' combo populates another combo with Company names that start with this letter.
I have similar situation with UserNames, over 600 users, for authorization purpose.
I don't disagree with your approach long term. But I need to clean up the 100,000+, as they are used downstream in a pivot table. That pivot's summary is skewed because of the name errors. If I can perform the cleanup in an automated way it would save me a lot of manual clean-up. I'm thinking a spellcheck on the company name column using just the 120 names as input would clean up the vast majority of errors.
Similar to strongm, I was going to suggest Levenshtein Distance. I don't see any VB6 code on that page, but it shouldn't be too difficult to convert the code that is there.
-George
Microsoft SQL Server MVP My Blogs SQLCop twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
Can the database be read by MsAccess?
If so you could open the table and by using totals and grouping, create a list of all names with a count of each company. This would immediately show you how many were miss spelt. Instead of 100 companies you could get say 110 indicationg the 10 wrong ones.
Then execute an update query that changes each wrong names to the right one. Run this only for each of the 10 wrong names.
If you haven't MsAccess you can do it with Record sets in vb6 code but its harder to write the correct code.
Best way to not get duplication errors is to allow users to only select a name from an alphabetical table that has to have a "customer account created" first. It is easier to spot if someone enters the same company spelt differently.
A problem can still occur if someone enters a second entry for the same person eg T.Smith or Smith T. which is why they have separate fields for first and family names.
I often design a query for VB6 code using Msaccess then paste the SQL code across to a Vb6 execute statement (with a few changes to suit). You can test it easier that way.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.