Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter Revisited
Message
De
25/04/2005 15:05:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01008184
Message ID:
01008190
Vues:
13
Kevin,

Your SelectCmd fields don't match the CursorSchema fields. If you specify exactly the fields you want instead of using * you should work around that.

>Ok, this is a bit long, but I'm not sure whats wrong. I'm getting an error:
>
>"Base table fields have been changed and no longer match view fields. View
>field properties cannot be set"
>
>Heres the code and table structures:
>
>
>
>SET MULTILOCKS ON
>
>CLOSE DATABASES ALL
>
>LOCAL oCursor as CursorAdapter
>LOCAL aErrors[1]
>cRetVal = ""
>
>SELECT 0
>USE "d:\projects\vfp1\bm\version1\source\data\clients.dbf"
>
>SELECT 0
>USE "d:\projects\vfp1\bm\version1\source\data\companies.dbf"
>
>oCursor = createobject("CursorAdapter")
>
>WITH oCursor
>
>.DataSourceType = "Native"
>.Alias 		= "ClientInfo"
>.AllowDelete 	= .T.
>.AllowInsert 	= .T.
>.AllowUpdate 	= .T.
>.CursorSchema	= "RecId C(8), Comp_Name C(40), Cl_Name	C(40), Active L"
>.KeyFieldList 	= "RecId"
>.SelectCmd  	= "SELECT Clients.*, Companies.* "+;
>	            "FROM Clients "+;
>	            "JOIN Companies ON Clients.CompanyId = Companies.RecordId "+;
>	            "WHERE Clients.RecordId = 'HG0M7JTZ'"
>.SendUpdates    = .T.
>.Tables         = "Clients, Companies"
>.UpdatableFieldList = "Comp_Name, Cl_Name"
>.UpdateNameList     = "Comp_Name Companies.Company, Cl_Name Clients.Client_Name"
>
>
>IF .CursorFill(.T.)
>
>  .CursorDetach()
>		
>  BROWSE
>		
>  .CursorAttach("ClientInfo")
>		
>  =TABLEUPDATE(1)
>
>ELSE
>  AERROR(aErrors)
>  MESSAGEBOX(aErrors[2],48,"Error Occured")
>ENDIF
>
>ENDWITH
>
>RETURN
>
>
>The 2 tables:
>
>
>
>Structure for table:    CLIENTS.DBF
>Field  Field Name      Type                Width    Dec
>    1  RECORDID        Character               8
>    2  COMPANYID       Character               8
>    3  CLIENT_NAME     Character              40
>    4  ACTIVE          Logical                 1
>
>
>Structure for table:    COMPANIES.DBF
>Number of data records: 3
>Date of last update:    03/31/05
>Code Page:              1252
>Field  Field Name      Type                Width    Dec
>    1  RECORDID        Character               8
>    2  COMPANY         Character              40
>
>
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform