Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'field' phrase is not found?
Message
From
03/08/1999 21:48:45
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00249519
Message ID:
00249558
Views:
16
>I have a form with a grid with it's recordsourcetype set to Alias and it's record source set to a table which is in the form's data environment. When the form opens the grid appears with the data showing, but immediately I get an error "'field' phrase is not found". When I close the error box the grid disappears, leaving a white box in it's place. I cannot find that error in Help, so what does it mean?
>
>Further info... I have verified that each column is set to a valid field name in the table, and there is no code in any of the grid's methods.
>
>Thanks.



Um.. May be you copy the following code as Error Handler, and then get more information on the error you got!

Remember to set the Error handler:

ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )



*** Errhand.prg ***
PROCEDURE Errhand
PARAMETER merror, mess, mess1, mprog, mlineno
	PUBLIC DEBUGING	&& NEED DEBUG FLAG!
	DO CASE
	CASE Merror = 1884	&& Duplicate Key
		TABLEREVERT(.T.)
		
	CASE Merror = 109	&& Skip Using Record Error!
		RETRY

	CASE Merror = 5	&& WRONG RECNO() -1
*		TABLEREVERT(.T.)

	OTHERWISE
		CLEAR
	ENDCASE
	SET MESSAGE TO
	=MessageBox(	'Error number:	' + LTRIM(STR(merror)) + chr(13) +;
				'Error message:	' + mess + chr(13) +;
				'Program:		' + mprog + chr(13) +;
				'Line number:	' + ALLTRIM(STR(mlineno)) + chr(13) +;
				'Error code:' + repl(chr(13),2) + [> ] + mess1;
				, 48, "Error Message Found!!")
	DO CASE
	CASE VERSION(2) = 2 .AND. DEBUGING = .F. && Development Time and First Error Occur!
		DEBUGING = .T.
		ACTIVATE WINDOW TRACE
		SUSPEND

	CASE VERSION(2) = 2 .AND. DEBUGING = .T. && Development Time and 2nd Error Occur!
		IF MESSAGEBOX("Stop Debug?!", 1, "Error Handler!") = 1
			CANCEL
		ELSE
			DEBUGING = .F.
			*RESUME
		ENDIF
	ENDCASE
ENDPROC





Now you can get the error number!
At Help (VFP 5.0), Click "Content" Tab,
DoubleClick "Technical Reference",
DoubleClick "Error Message",
Select "Error Number",
Find the Corresponding Error # to see the error meaning!




Now, up to my experience, you have opened a table with a old work area
Or you have NOT use a NEW work area (new area is 0) to open a new CURSOR!!

e.g.

Use myTable
Use MyChild
Select myTable && This line will get error because myTable Has Closed and myChild take that work area!!

So, what is the correct issue to open table?!

Use MyTable AGAIN in 0 Order Tag myKey Shared
Use MyChild AGAIN in 0 Order Tag ChildKey Shared
Select myTable && You Now can select myTable!

- Again, allow the table re-open in same application, especially you need to check any duplicate key..
- In 0, Sure use a New Work Area to open the table
- Shared, Allow multi-use as shared, to handle multi-user on the table, see Knowledge base article!

Another similar case, if you have one SELECT Cursor, and need to make another one..

Select .... into tmpCursor
SELECT 0 && jump to new work area
Select ..... into newCursor

Otherwise, Surely the tmpCursor will be closed for Same reason!

^_~ Good Luck!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform