Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug? - Select in dbc_AfterOpenTable() causes infinite lo
Message
From
22/04/2004 05:19:44
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00897019
Message ID:
00897129
Views:
16

I am using Visual FoxPro 8 Service Pack 1.
To duplicate what looks like a bug:

Create a dbc_AfterOpenTable() event procedure.
Put a SQL SELECT statement in there.
Select any fields FROM THE TABLE BEING OPENED,
into any destination (TO SCREEN, INTO CURSOR).

Result:
The SELECT statement causes the AfterOpenTable() to call itself infinitely.
Eventually FoxPro will give an error.

Isn't this a bug?


No. All dbc calls allow recursion.

You must cut the recursion:
PROCEDURE dbc_AfterOpenTable()
IF VARTYPE(M.g_dbc_AfterOpenTable_TABLENAME)=='U'
   PUBLIC g_dbc_AfterOpenTable_TABLENAME
   Select any fields FROM TABLENAME into any destination (TO SCREEN, INTO CURSOR).
   RELEASE g_dbc_AfterOpenTable_TABLENAME
ENDIF
You can use ASTACKINFO() also, but the Mutex is more selective.

try this also:
PROCEDURE dbc_AfterOpenTable()
   Select any fields FROM ALIAS() into any destination (TO SCREEN, INTO CURSOR).
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform