Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Environnement and Network
Message
From
21/01/1999 18:28:53
 
 
To
21/01/1999 18:16:14
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00178775
Message ID:
00178786
Views:
21
>If you don't mind, I would like to see a sample of what you told me.
>
>Thank's again Erik,
>
>Christian

I quickly chopped irrelevant code out of my Form.buildDE to show the gist of the routine:
********************************************
IF THISFORM.DataEnvironment.AutoOpenTables = .T.
	* Tables are already opened, can't change the database property
	RETURN
ENDIF

LOCAL lnCnt, loObj, lcDBC

LOCAL ARRAY laList[1]

* If the application object does not exist because we are running in test mode, don't change the paths
IF TYPE('oApp.Name') <> "C"
	RETURN
ENDIF

lcdataPath = oApp.DataPath

*** Get Object Members of DE
=AMEMBERS(laList, ThisForm.DataEnvironment, 2)
IF EMPTY(laList[1])
     *** Nothing in DE
     RETURN
ENDIF

IF ALEN( laList,1 ) > 0
	FOR i = 1 TO ALEN(laList,1 )
	     loObj =  EVAL("ThisForm.DataEnvironment."+laList[i])
	     IF LOWER(loObj.BaseClass ) = 'cursor' and "\"$loObj.Database
	          IF !EMPTY(loObj.Database)
	                *** Contained Table
	               lcDBC = SUBSTR( loObj.Database, RAT('\', loObj.Database ))
	               loObj.Database = lcDataPath + lcDBC
	          ELSE
					*** Free Table
                   lcDBC = SUBSTR( loObj.CursorSource, RAT('\',loObj.CursorSource ))
	               loObj.CursorSource = lcDataPath + lcDBC
	          ENDIF
	     ENDIF
	NEXT
ENDIF
I hope this helps. If you are still have questions, fire away.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform