Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter Error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01010861
Message ID:
01010927
Vues:
34
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
>
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform