Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SYS(2023) sometimes returns blank
Message
 
To
19/02/2010 03:58:50
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01449863
Message ID:
01450020
Views:
59
OK, it's great protocole...

The problem can be with reading config.fpw at starting/creating COM... because only in config.fpw you can specify temp path.

MartinaJ

>GetTempPath() returns the same result as GETENV("TEMP") -- C:\WINDOWS\TEMP. However return value from SYS(2023) randomly seems to return empty string, other times C:\WINDOWS\TEMP.
>
>Perhaps I should clarify the situation, it's not that the SYS(2023) function is the cause of the problem, but rather a symptom. In the situations where SYS(2023) would return a blank value, the implicitly generated .TMP files ( say for those generated when you do SELECT INTO CURSOR ) that FoxPro ends up trying to create the TMP file in the root folder -- and since the identity being used doesn't have rights to write to the root folder, the it crashes. I can work around this problem in some cases -- such as where I might use SELECT INTO CURSOR. All I have to do is to generate filename myself (e.g. GETENV("TEMP")+SUBSTR(SYS(2015),3,10), then use that as the target of a SELECT INTO TABLE statement. However there remain other commands where .TMP files are generated implicitly that I can't avoid.
>
>As a test I temporarily granted the user read/modify/write/delete access to the root folder (which implicitly gives rights to *all* folders and files on the drive) -- and sure enough, everything starts working (aside from the return value from SYS(2023) randomly alternating between C:\WINDOWS\TEMP and blank). Similarly, by setting identity used by the COM object as an administrative user gets stuff working too -- but I've noticed that SYS(2023) now alternates between blank, C:\WINDOWS\TEMP and some other seemingly random folder. Unfotunately I'm not really happy with such solutions as it entails compromising system security by granting more rights to users than would otherwise be required...
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform