Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter Error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
CursorAdapter Error
Miscellaneous
Thread ID:
01010861
Message ID:
01010861
Views:
82
My CA is working fine - until I set the CursorSchema.

When I set the CursorScheme, I get the error

"Base table fields have changed and no longer match view fields. View
field properties cannot be set"


Here's my code:
LOCAL oAdapter

oAdapter = CREATEOBJECT("CursorAdapter")

WITH oAdapter

.Alias = "ErrRecord"
.AllowInsert = TRUE

.CursorSchema =;
	"RecordId C(8), "+;
        "DateTime D, "+;
        "Error N(10), "+;
	"Line N(10), "+;
        "Message M, "+;
	"CodeLine M, "+;
        "Program M, "+;
        "User C(25), "+;
	"AppName C(20), "+;
	"NetWrkName C(30), "+;
        "Memory M, "+;
        "Status M, "+;
	"CallStack M"
											
.DataSourceType = "Native"
.KeyFieldList	= "RecordId"
.Tables	= "SysErrors"

.UpdatableFieldList	=;
	"RecordId, DateTime, Error, Line, Message, " +;
	"CodeLine, Program, User, AppName, NetWrkName, "+;
	"Memory, Status, CallStack"

.UpdateNameList =;
	"RecordId Errors.RecordId,"+;
	"DateTime Errors.DateTime,"+;
	"Error Errors.Error,"+;
	"Line Errors.Line,"+;
	"Message Errors.Message,"+;
	"CodeLine Errors.CodeLine,"+;
	"Program Errors.Program,"+;
	"User Errors.User,"+;
	"AppName Errors.AppName,"+;
	"NetWrkName Errors.NetWrkName,"+;
	"Memory Errors.Memory,"+;
	"Status Errors.Status,"+;
	"CallStack Errors.CallStack"

.SelectCmd = "select * from syserrors where RECNO() = 1"
.SendUpdates = .T.

IF .CursorFill(TRUE, FALSE)
*				IF .CursorFill(FALSE, FALSE)

	SELECT ErrRecord
	SCATTER NAME oRecord BLANK MEMO
	
	oRecord.RecordId		= This.sRecordId
	oRecord.DateTime 		= DATETIME()
	oRecord.Error				= This._iError
	oRecord.Line				= This._iLine
	oRecord.Message			= This._sMessage
	oRecord.CodeLine		= This._sCodeLine
	oRecord.Program			= This._sProgram
	oRecord.User				= This._sUser
	oRecord.AppName			= This._sAppName
	oRecord.NetwrkName	= This._sNetwrkName
	oRecord.Status			= This._sStatus
	oRecord.Memory			= This._sMemory
	oRecord.CallStack		= This._sCallStack

	GATHER NAME oRecord MEMO
	
	=TABLEUPDATE(TRUE)

ELSE
	** Handle error here
	AERROR(aErrInfo)
	iErr = aErrInfo[1]
	sErr = aErrInfo[2]
	MESSAGEBOX(TRANSFORM(iErr) + " - " + sErr,48, "Error")
ENDIF

ENDWITH
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