Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can a VFP application have Write rights?
Message
 
To
26/04/2005 13:02:31
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01008493
Message ID:
01008572
Views:
19
>If my application does log on as another user, can it just copy the file and then immediatly revert back to the original user?

Joel,

Yes, it does. I had a similar task: providing regular read-write access to a folder with DBF files from within a VFP application, while preventing users to access this folder in Explorer.

I used API calls LogonUser, ImpersonateLoggedOnUser and RevertToSelf. The last call is actually answers your question.

It took time to make it work though. Possible issues:

- you need to reconnect to required network resources (network drives, printers) for the temporary user

- make sure that the path to temporary FoxPro files is valid for impersonated user -- important when you run SQL statements, reindex tables and so on under temporary user's credentials.
Previous
Reply
Map
View

Click here to load this message in the networking platform