Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange error message - any ideas
Message
From
16/12/2005 08:54:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01078433
Message ID:
01078618
Views:
14
Hi Sergey,

Sorry for the delay, I left UT open and went away for the night. I don't know where the "select" comes from, it puzzles me. I couldn't recall it and I made a search for the word "recno()" in my code and couldn't find it, at least not in the form the error comes from. The cursor name is also very very strange I never use such names as "viewcalv96", I do often use lcCursor = Sys(2015) and &lcCursor. as cursor name, I'm expecting something starting with an underscore.

This was a very good question, thanks. The "select" statement is from this variable :
lcCodeLineMsg=MESSAGE(1)

Could it be somebody else had an error at the same time and I got the other person error message? Makes me wonder. I will change errorhandler and pass Message(1) as a parameter right away to catch it earlier. any other suggestion?

BTW the form runs inside an application object
My on error procedure is this :
ON ERROR ErrorHandler(ERROR(),PROGRAM(),LINENO())

*********************
FUNCTION ErrorHandler
*********************
LPARAMETER nError,cMethod,nLine
LOCAL lcErrorMsg,lcCodeLineMsg, lnSessionID
?? CHR(7)	&& Ring the bell
WAIT CLEAR
lnError = nError
IF lnError = 1001	&& Feature not available - set step on
	RETURN .T.			
ENDIF
lnLine = nLine
lnSessionID = _SCREEN.DataSessionID		

lcErrorMsg=STR(nError) + ' - ' + MESSAGE()+CHR(13)+CHR(13)
lcErrorMsg=lcErrorMsg+"Method:    "+cMethod
lcCodeLineMsg=MESSAGE(1)
IF BETWEEN(nLine,1,10000) AND NOT lcCodeLineMsg="..."
	lcErrorMsg=lcErrorMsg+CHR(13)+"Line:      "+ALLTRIM(STR(nLine))
	IF NOT EMPTY(lcCodeLineMsg)
		lcErrorMsg=lcErrorMsg+CHR(13)+CHR(13)+lcCodeLineMsg
	ENDIF
ENDIF
IF lnError != 1958
	lcErrorMsg = lcErrorMsg +CHR(13)+ " Application will close itself."	
ENDIF
IF MESSAGEBOX(lcErrorMsg,16,_screen.Caption)= 1  && OK (no cancle)
   IF lnError = 1958
	RETURN .T.
   ENDIF
  lForm = .F.
  IF TYPE("_Screen.ActiveForm") = "O"
	poActiveForm = _Screen.ActiveForm
	IF UPPER(poActiveForm.BaseClass) == "FORM"
		lForm = .T.
		lnSessionID = poActiveForm.DataSessionID
	ENDIF
   ENDIF	
   IF TXNLEVEL() > 0		
	IF lForm
  	  SET DATASESSION TO poActiveForm.DataSessionID
	ENDIF
	ROLLBACK
	UNLOCK ALL
   ENDIF
		
   IF !USED("SyLogError")
	USE SyLogError IN 0
   ENDIF	
  INSERT INTO SyLogError (dError, cUserID, nError, cMess, cMess1, cMess2, cProgram, nLine) ;
	VALUES(DATETIME(), sgcUserID, lnError, MESSAGE(), MESSAGE(1), SYS(2018), cMethod, lnLine )

   USE IN SyLogError

  SET DATASESSION TO lnSessionID	
  CANCEL			

  ENDIF
RETURN
Diane Robitaille eng.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform