Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Views looking at workarea, not the 'live' directory tabl
Message
From
08/07/2002 10:44:23
 
 
To
08/07/2002 09:29:32
Angela Haws
Seminole County Tax Collector
Debary, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00675737
Message ID:
00676121
Views:
16
SNIP
>Anyways, yes I was using the DE of the forms. I will try to learn alot more about the application object, so I can use the code from above. Any suggestions on links to learning about the app.object? Thanks again
>Angie

Angie,
Even if you don't use an app object, the modified code below in your beforeopentables method of the forms' dataenvironment should work for you. Change it to a relative path of where-ever the database is stored (use same path but different drive letter for live and temp) and then when you work with either the temp copy or live copy it should work. It will substitute whatever the current drive is when you run it.

If you absolutely need to specify a drive letter (don't recommend this), you could pass a value to the form with the drive letter (depending on live or test,etc) and set the path accordingly. I guess it also depends on where you run the live app from (locally or on server) and where the database is actually stored. YOu could post it (the live and temp database paths and the location of where your app itself runs from) if you like and then the code below could be modified even further to meet your needs. Does that help?
* Set the data directory
LOCAL lcPathSet, lnCount, lcDatabase
*--Make sure there is no drive letter here and then it will find the path
*--using the current drive letter whatever it is like the example below
lcPathSet = "\Profiler\Data\"
* Get list of members of the DataEnvironment
lnObjects = AMEMBERS(laObjects, THIS, 2)
* Look at each member object, but only process cursors.
FOR lnCount = 1 TO lnObjects
	loObject = EVALUATE('THIS.' + laObjects[lnCount])
	IF UPPER(loObject.BASECLASS) = 'CURSOR'
		lcDatabase = loObject.DATABASE
		* If this is a free table, we can leave it. Else....
		IF !EMPTY(lcDatabase)
			loObject.DATABASE = lcPathSet + SUBSTR(lcDatabase, RAT('\', lcDatabase) + 1)
		ENDIF EMPTY(lcDatabase)
	ENDIF UPPER(loObject.BASECLASS) = 'CURSOR'
NEXT lnCount
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform