Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Loop through cursors in dataenvironment & chg DBC
Message
De
27/05/1998 11:45:30
 
 
À
27/05/1998 11:34:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00102387
Message ID:
00102392
Vues:
23
>When instantiating a form in the BeforeOpenTables() method I place the following code:
>"=SETDATA(thisform)" which calls the following function:
>
> FUNCTION SETDATA
> *
> LPARAMETER oForm
> LOCAL lcDBCPathName
> * gcUNC is a global variable containing the UNC path to the database container
> lcDBCPathName = gcUNC + 'fanmail\data\fanmail.dbc'
> oForm.SETALL("database",lcDBCPathName,"cursor")
>
>This works great except for one specific form in which I use tables from two different database containers.
>
>How can I loop through the data environment. I realize I can access it via:
>ThisForm.dataenvironment.cursor1.database = " your database "...
>But I have no clue how to loop through each database property within the dataenvironment, check which dbc it is and point it to the correct network table instead of the development one. Can anyone help ?
>
>TIA

Something like this:
***DE.BeforeOpenTables event
=amembers(myarray,this,2)
for n=1 to alen(myarray)
 cMembername=myarray[n]
 if this.&cMembername..database="somthing"
  this.&cMembername..database="something_new"
 endif
endfor
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform