>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 >