Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00980399
Message ID:
00981048
Vues:
30
Hi Kevin,

KeyFieldList uses local field names and, according to the CursorSchema property, you should use KeyFieldList="Col1" instead of KeyFieldList="cust_id".

Similar with UpdatableFieldList and UpdateNameList
.KeyFieldList="Col1"
.UpdatableFieldList = "Col1, Col2 , Col3 "
.UpdateNameList = "Col1 customer.cust_id, Col2 customer.company, Col3 customer.contact"
Thanks,
Aleksey.

>I'm not sure about the usage of the 'CursorSchema' property. I'm getting the
>error "Invalid key column 'cust_id'" when I run this.
>
>
>LOCAL loCursor AS CursorAdapter
>LOCAL laErrors[1]
>
>OPEN DATABASE (_samples + "data\testdata")
>
>loCursor = CREATEOBJECT("CursorAdapter")
>
>WITH loCursor
>
>	.Alias = "CustomerCursor"
>	.DataSourceType = "Native"
>	.SelectCmd = "select cust_id, company, contact from customer where country = 'Brazil'"
>	.KeyFieldList = "cust_id"
>	.Tables	 = "CUSTOMER"
>	.UpdatableFieldList = "cust_id, company, contact"
>	.UpdateNameList = "cust_id customer.cust_id, company customer.company, contact customer.contact"
>	.CursorSchema = "Col1 C(25), Col2 C(25), Col3 C(25)"
>	
>	IF .CursorFill(.T.)
>	
>		BROWSE
>		TABLEUPDATE(1)
>	
>	ELSE
>	
>		AERROR(laErrors)
>		MESSAGEBOX(laErrors[2])
>	
>	ENDIF
>
>	CLOSE DATABASES ALL
>	
>ENDWITH
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform