Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loading data for Page Frames with Grids
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00365936
Message ID:
00367184
Vues:
12
>Bret,
>
>Earlier in this thread you mentioned not opening a view unless the user selected the page of the pageframe that uses the view. You said you first checked to see if the view was opened, and if it wasn't you would open it. I am not clear about the difference in the "dataenvironment" and just opening a view. I have been trying like the "dickens" to figure this out. Two questions:
>
>1)In the Activate method of the page, am I just doing the SQL - SELECT statement of my view, or am I suppose to somehow add a view to the data environment of the form at run time? Can you give me a boost on this?
>
>2)How to I check to see if the view is already opened?
>
>Thanks
>
>Elgin

I dont use data environments. I control all my tables being opened myself, either in the load event of the form or when a specific table/view is needed for some function or display. My theory is this, if the form is a single use form (works on only one table for maintenance or viewing records) then I will open up the database and the table in the load event of the form. If the form will allow the user to view many tables as a multi-use form, I would hold off opening the view until the user requests that info, because they may or may not request a certain view in all incidents of opening the form. So then why would I want to add overhead of opening the views in the load event. Even if I use the NODATA clause there is still overhead. So I will put the code to open the views when the user requests them in mostly the requery method of a list or the activate method of the page.

Here is code I use to check if a view is open in the requery method of a list lets say:

* Set up my parameter
vp_dmadockey = THISFORM.nKeyToGoTo

* Check if the view is already around
*
IF !USED("v_dma_ondockey")
USE v_dma_ondockey IN 0
ELSE
REQUERY("v_dma_ondockey")
ENDIF
* Find out how many records we found
lnTally = _TALLY

ETC....
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform