Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Beforeopentables and returning .f.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00944089
Message ID:
00944167
Vues:
16
This message has been marked as the solution to the initial question of the thread.
Give this a try:

- Add a property called lAbort and set it to .t.

- In the Load method, add this code:
DODEFAULT()
IF ThisForm.lAbort
  RETURN .f.
ENDIF
- In the Data Environment OpenTables method, add this code:
NODEFAULT
IF FILE('JUNKX.DBF')
  DODEFAULT()
ELSE
  ThisForm.lAbort = .t.
ENDIF
>Typically I open the tables manually in a form's load (close them in the form's unload) and return .f. if the tables do not exist, etc so the form never loads, but:
>
>When autoopentables is .T. and the dataenvironment is used to open/close tables:
>
>is there was a way to cancel the form's load if a table does not exist by checking for its existance in the beforeopentables event of the dataenvironment? I have tried this by returning .f. but it appears that the data environment still attempts to open the form and returns the failure to instantiate object error message and then fails to load the form.
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform