Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View not updating data
Message
 
 
To
09/08/2006 09:58:11
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01143996
Message ID:
01144122
Views:
19
>Thanks Naomi,
>
>I keep getting the error "No key columns are specified for the update table "Guinty!PKG". Use the keyfield property of the cursor" Excuse my ignorance, but how do I set this key field? I have used all kinds of permutations and combinations in the view designer's Update Criteria tab, and yes, treating one as updatable, and one as the parent(non updatable). I'm sure I've done something stupid, but not sure what. Any suggestions, please?
>
>Regards,
>
>Steve.

What is the PK for your table? In the View designer you should set this field as a key field (it would have two checks for the field in the designer). I also never tried distinct clause for updatable view. Usually the view is based on one table. Here is a sample of updatable view:
SELECT Accidents.*;
 FROM ;
     mmviscollect!accidents;
 WHERE  Accidents.caccidents_pk == ( ?vp_cAccidents_pk )

DBSetProp(ThisView,"View","SendUpdates",.T.)
DBSetProp(ThisView,"View","BatchUpdateCount",1)
DBSetProp(ThisView,"View","CompareMemo",.T.)
DBSetProp(ThisView,"View","FetchAsNeeded",.F.)
DBSetProp(ThisView,"View","FetchMemo",.T.)
DBSetProp(ThisView,"View","FetchSize",100)
DBSetProp(ThisView,"View","MaxRecords",-1)
DBSetProp(ThisView,"View","Prepared",.F.)
DBSetProp(ThisView,"View","UpdateType",1)
DBSetProp(ThisView,"View","UseMemoSize",255)
DBSetProp(ThisView,"View","Tables","mmviscollect!accidents")
DBSetProp(ThisView,"View","WhereType",3)

DBSetProp(ThisView+".caccidents_pk","Field","Comment","ACCIDENTS KEY")
DBSetProp(ThisView+".caccidents_pk","Field","DataType","C(16)")
DBSetProp(ThisView+".caccidents_pk","Field","UpdateName","mmviscollect!accidents.caccidents_pk")
DBSetProp(ThisView+".caccidents_pk","Field","KeyField",.T.)
DBSetProp(ThisView+".caccidents_pk","Field","Updatable",.T.)
<snip>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform