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?
LOCAL lcPathSet, lnCount, lcDatabase
lcPathSet = "\Profiler\Data\"
lnObjects = AMEMBERS(laObjects, THIS, 2)
FOR lnCount = 1 TO lnObjects
loObject = EVALUATE('THIS.' + laObjects[lnCount])
IF UPPER(loObject.BASECLASS) = 'CURSOR'
lcDatabase = loObject.DATABASE
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"