>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