>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( )
PROCEDURE Errhand
PARAMETER merror, mess, mess1, mprog, mlineno
PUBLIC DEBUGING
DO CASE
CASE Merror = 1884
TABLEREVERT(.T.)
CASE Merror = 109
RETRY
CASE Merror = 5
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.
DEBUGING = .T.
ACTIVATE WINDOW TRACE
SUSPEND
CASE VERSION(2) = 2 .AND. DEBUGING = .T.
IF MESSAGEBOX("Stop Debug?!", 1, "Error Handler!") = 1
CANCEL
ELSE
DEBUGING = .F.
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 areaOr 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 SharedUse MyChild
AGAIN in 0 Order Tag ChildKey SharedSelect 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.