Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding CursorAdapter methods
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01475311
Message ID:
01475405
Views:
18
>
>
>Could you script the class with Class Browser and post it here?

This is the segment of the my code relevant to this discussion. You obviously can't run it
but I wonder if anything jumps as being wrong
	this.ca_object.keyfieldList = ALLTRIM(cPkFieldName)  &&  'COMP_PK'
	this.ca_object.tables = tcTableName                  &&  'COMPANY'
	this.ca_object.UpdatableFieldList = cUpdatableFieldList &&  'COMP_PK, COMP_NAME, ADDRESS1, ..'
	this.ca_object.UpdateNameList = cUpdateNameList         &&  'COMP_PK TABLENAME.COMP_PK, COMP_NAME TABLENAME.COMP_NAME ..'
	this.ca_object.identity_field = "COMP_PK"    		
	this.ca_object.AllowUpdate = .T.

	LOCAL oRS
	oRS = CREATEOBJECT("ADODB.Recordset")
	oRS.DataSource.CursorLocation = 3
	oRS.DataSource.Locktype = 3
	oRS.ActiveConnection = oApp.oConn
	oRS.Open(tcSqlSelectExpression, , 1) 				  && tcSqlSelectExpress = 'select * from Company'

	this.ca_object.Alias = tcViewName					  && "V_COMPANY"

	*-- Fill cursor adapter 
	IF !this.ca_object.CursorFill(,,,oRS)
		AERROR( aErrorInf )
		this.error_message_text = "SQL Select expression: " + CHR(13) + ;
			tcSqlSelectExpression + CHR(13) + ;
				"Error Message: " + aErrorInf[1,2]
			this.error_message_title = "Failed Execute Cursor Fill Method"
			this.error_number = aErrorInfo[1,1]				

		lReturn = .F.
	ENDIF 
	
	SELECT V_COMPANY
	
	APPEND BLANK 
	
	=TABLEUPDATE(1,.t.,"V_COMPANY")
	
	BROWSE 
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform