Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug? - Select in dbc_AfterOpenTable() causes infinite lo
Message
De
22/04/2004 05:19:44
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00897019
Message ID:
00897129
Vues:
15

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform