> Tushar, the trouble is that the tmpfiles setting is established very early in VFP's instantiation. After which it cannot be changed. So, if you alter the tmp or temp environment variable inside your VFP app, VFP does not see the change. You could make the change in a wrapper which is fine if you're running the app yourself which generally is not the case for a com app. If you do wrap your com app in a wrapper that sets a new tmpfiles location, running the vfp app will yield a separate process- iow it will be the wrapper rather than your vfp app that is accessible to the calling application via com. I suppose it would be possible to create a com wrapper that changes tmpfiles and then provides passthrough access to everything in your app... I'll think about that.
If that's not successful, then you could SELECT INTO TABLE instead of INTO CURSOR and create the temporary tables yourself. This may be a big pain if you have lots of SELECT statements in your program.
But you can create a GUID (Globally Unique IDentifier) and use that for your temporary table name like so:
declare integer CoCreateGuid in OLE32.DLL string @lcGUID
lcBinaryGUID=space(16)
CoCreateGuid(@lcBinaryGUID) &&Set lcGUID in Binary Form
lcGUID=""
for xx=1 to 16 step 4
lcGUID=lcGUID+rightc(transform(ctobin(substrc(lcBinaryGUID,xx,4)),"@0"),8)
endfor
lcTempFileName=lcTempPath+lcGUID+".DBF"
select ... into table (lcTempFileName)
use (lcTempFileName) exclusive alias CursorName
Just an idea...
--Brad