Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter Error
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01010861
Message ID:
01010947
Views:
34
Mark,

I updates the SelectCmd to include only the fields I need.

I no longer get errors, but the record is not written out.

Any ideas?



>Just a couple of guesses here. Modify your SelectCmd so the where clause is a filter on one of the "real" fields in the table instead of using RECNO(). When you pass FALSE for using the CursorSchema, do you get the same field order in the cursor structure as what you have in the CursorSchema property? If not, modify your CursorSchema to match.
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform