Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for duplicate data entered in a grid.
Message
From
11/11/1996 22:40:19
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00011942
Message ID:
00012016
Views:
40
>>Hi. I'm using a grid to enter/update attendance violations by employees. The problem is this: >>I have a primary index on three fields in the violation table: dtos(date)+emp_id+viol_cd (which is entered from a combo box). I do a seek command in the interacive change method of the combo box using the name of the objects on the screen and not the actual table field names. No sysntax error or runtime errors there... >>But when I execute the seek I get "Uniqueness of index violated" or something to thst effect. After some research, I discovered that I should chamge the buffering for the violation table from optimistic record buffering to optomistic table buffering, because when the record pointer moves for the seek, foxpro attempts to save the record when "optimistic record buffering" is used. The problem is that I now get "Uncommitted changes in table 'violation'". > >this is essentially the same problem -- the record won't be saved wo/ explicitly saving it. what you should do is use sql to locate other matching records (select * from mytable where dtos(date) = mytable.date and emp_id = mytable.emp_id, etc.) if _tally > 1, record already exists. remember w/ buffering, the record you're adding is technically in the table already.

Thanks Dave, that makes sense. Using SQL should eliminate
the "buffering" problems. I'll let you know how tht works
out.

Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform