Klaudiusz Witoszek


Hello,

I have application lately moved from VFP8 to VFP9. As it is recomended for Windows Vista, I have program files installed in "Program Files" folder. There's no any write operations to this folder. DBF files are installed into "ProgramData" Windows Vista special folder. I tested it on my Vista test machine with UAC turned on and it works fine. It works fine also on account without administative rights. Unfortuantelly, I have a very big problem because a lot of people using this application on Vista is unable to use it because of write error to DBF files. For example, they get error "Cannot update the cursor MY_DATA, since it is read-only" when I try to UPDATE my_data.dbf table (table installed in ProgramData subfolder as I mentioned before). If works fine if I turn off UAC or right click shortcut and run program as administrator. But I don't want to use such methods. Please, help.

Klaudiusz Witoszek





Re: VFP9 - Windows Vista - proble with writing in ProgramData folder

dni


How do you create cursor MY_DATA Are you using readwrite option







Re: VFP9 - Windows Vista - proble with writing in ProgramData folder

Klaudiusz Witoszek

my_data.dbf - this is static free table in folder C:\ProgramData\IC_Katalog\Common\

Code raising exception looks like this:

lcTemp = "C:\ProgramData\IC_Katalog\Common\my_data"

UPDATE (lcTemp) SET i_cars = g_cPath, DAT_OTW = DATETIME()







Re: VFP9 - Windows Vista - proble with writing in ProgramData folder

dni

You may check if user has write right in that folder..






Re: VFP9 - Windows Vista - proble with writing in ProgramData folder

Lionel

Hello,

Users don't have write right to ProgramData folde ans subfolders.

I had the same problem. The only way is to share or change acces right of you data folder. If you share the forder, you will be able to access by network.

#DEFINE SHARED_FOLDER 0

lnMaximumAllowed = 10

TRY

objSWbemServices = GETOBJECT('winmgmts:\\.\root\cimv2')

CATCH

FINALLY

ENDTRY

IF TYPE('objSWbemServices') # 'O'

#DEFINE Shared_Folder3_LOC "Error"

MESSAGEBOX(Shared_Folder3_LOC, MB_OK + MB_ICONSTOP, _Screen.Caption)

RETURN

ENDIF

&& Computer name

lcRep = LEFT(SYS(0), AT(' # ', SYS(0)) - 1)

objSWbemObject = objSWbemServices.Get('Win32_Share')

#DEFINE LEO_Shared_Folder1_LOC "MyApp"

lnValeur = objSWbemObject.Create("C:\ProgramData\MyApp", ;

"MyApp", ;

SHARED_FOLDER, ;

lnMaximumAllowed, ;

"MyAppShare")

IF lnValeur # 0

#DEFINE Shared_Folder2_LOC "Error"

MESSAGEBOX(Shared_Folder2_LOC, MB_OK + MB_ICONSTOP, _Screen.Caption)

ENDIF








Re: VFP9 - Windows Vista - proble with writing in ProgramData folder

Klaudiusz Witoszek

You are right, by default ProgramData has no write access. I changed setup program to set required NTFS rights and now it's OK. Thank you.