-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
Paradox To/From
To/FromCODEGuides
Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

November Edition
Subscribe now! It's Free!
Enter your email:

   ► MB Lobby ► Corel Paradox / ObjectPAL Coding Board ► Paradox Forms Topic   Print This     

Detecting duplicate records.

Detecting duplicate records. in Paradox Forms topic (part of our Corel Paradox / ObjectPAL Coding group).

Quick Search: Detecting   duplicate   records   Detecting duplicate   Detecting duplicate records  
Kyle
New York
Hello. I have set up a databse program which allows users to enter data into a database. If the entry they input already exists in a field, a warning message will appear telling the user that the symbol already exists. This prevented the user from making duplicate entires.

However, I had to import a database from MS Excel into Paradox 7. This database already has records which have duplicate records. Now when I tested the the program to see if it still prevents users from entering duplicate records, I get 'An error was triggered in a Locate operation'.

What I would like to do is have this program to prevent any more duplicate records from being entered. Below is the code I used, which worked fine before I imported this new database.
--------------------------------------------------
method changeValue(var eventInfo ValueEvent)
var
ordTC TCursor
endVar
var aa string
tc TCursor
endVar

aa=eventInfo.newValue()

if aa <> self.value then
tc.open("COA2.db")

if tc.qLocate(aa) then
beep()
msgInfo("DUPLICATE RECORD!","Duplicate CFS Extraction code found! Check entry or contact your CFS Coordinator!")
disableDefault
eventinfo.setErrorCode(CanNotDepart)
endif
endif

endMethod

-----------------------------------------------

Any advice would be appreciated.

Thanks.
Kyle
 Posted 24 years ago (Thread Starter)
Comment Quote
About Kyle
Visit Profile
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #8636, 2 replies
Thread Started 12/13/2002 1:57:00 AM
View Counter=2272
Location=New York  
Joined=24 years ago   MB Posts=11  
Most Recent Post
Langley McKelvy
Harris County Texas, USA
Probably due to a change in location of the Database table. I think you'll find that the tCursor is not successfully opening. Try changing this:

tc.open("COA2.db")
to this:

if not tc.open("COA2.db") then
errorShow()
endif
Run it again and see if you get an error. Click the >> symbol on the dialog box to see what caused it.
Mac

[i]"A king will have his way in his own hall, be it folly or wisdom."[/i] - Gandalf
 Posted 24 years ago
Comment Quote
About Langley McKelvy
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Langley McKelvy
Computer Crimes Investigator / Computer Forensics Specialist Paradox for DOS/Windows Programmer

Post ID #8648 (Level 1.1)  Reply to 8636
Thread Started 12/13/2002 1:54:00 PM
View Counter=2
Location=Harris County Texas, USA  
Joined=24 years ago   MB Posts=387  
Leo
Civilized Africa
TRY THIS: (I HAVE NOT TESTED IT THOUGH, BUT IT SHOULD WORK)

var
ordTC TCursor ;// ???
newVal string
tc TCursor
oldVal string
endVar

oldVal=self.value
newVal=eventInfo.newValue()

if oldVal <> newVal then
tc.open(":ALIAS:COA2.db")

scan tc for tc."FIELDNAME"=newVal:
beep()
msgInfo("DUPLICATE RECORD!","Duplicate CFS Extraction code found! Check entry or contact your CFS Coordinator!")
setMouseShape(MOUSEWAIT,TRUE)
self.action(EditUndoField) ;// optional

disableDefault
eventInfo.setErrorCode(CanNotDepart)
return
setMouseShape(MOUSEARROW, TRUE)
endScan
else
endIf
Another Leo
_ _ ___________________ _ _
We are Micro$oft
You will be assimilated
Resistance is futile
 Posted 24 years ago
Comment Quote
About Leo
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #8637 (Level 1.2)  Reply to 8636
Reply Posted 12/13/2002 5:41:00 AM
Location=Civilized Africa  
Joined=24 years ago   MB Posts=96  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1136A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #8636 Counter
2272
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2026 Prestwood IT Solutions.   [Security & Privacy]  

 
↑