Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I disallow duplicate entries in my table?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00905919
Message ID:
00907172
Views:
17
>Hi Jojo

>This is sure only if you have a exclusive write access for the table.


>IF SEEK(...)
* NOW another session delete/change the record
***some code block
>ELSE
* NOW another session insert the record
***some code block
>ENDIF

Hi Fabio,

Actually, im not using that code.

I accustomed of using this on a valid event on a text box, not on a save button. The code is something like below..
cSearch = Alltr(this.value)
Set exact on
Select("Customer")
Set order to Custid
Seek(cSearch)
If Seek(cSearch)
   Set exact off
   Messagebox("Duplicate record is found!",0+16,"",1900)
   Return 0
ENDIF



I used this instead of putting the search when user save the record.. which is waste of time when the user type and save an entry which is already recorded..

One of the member here comment on my code and he meant the structure of my seek to be like code below..


>IF SEEK(...)
* NOW another session delete/change the record
***some code block
>ELSE
* NOW another session insert the record
***some code block
>ENDIF

Note: Im not using this above code with IF Seek() as I'm using early validation for duplicate records when appending new record to a table. I can used that structure when in a valid event for a text box and not in a save command button...
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform