Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter Revisited
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
CursorAdapter Revisited
Miscellaneous
Thread ID:
01008184
Message ID:
01008184
Views:
66
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       
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform