Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
READ-ONLY errors popping up !
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01630572
Message ID:
01630688
Vues:
56
>>Hi Gang!
>>
(snip)

>If it's the file itself that is readonly, you can change the attribute of the file like this...
>
>LPARAMETERS tlcFileName
>
>*-----------------------------------*
>* Full name of the file is required *
>*-----------------------------------*
>lcFileName = FULLPATH(tlcFileName )
>
>*--------------------------------------*
>* Define constants for file attributes *
>*--------------------------------------*
>#DEFINE FA_NORMAL 0 && Normal file. No attributes are set.
>#DEFINE FA_READONLY 1 && Read-only file.
>#DEFINE FA_HIDDEN 2 && Hidden file.
>#DEFINE FA_SYSTEM 4 && System file.
>#DEFINE FA_ARCHIVE 32 && File has changed since last backup.
>
>#DEFINE FA_VOLUME 8 && Disk drive volume label. Attribute is read-only.
>#DEFINE FA_DIRECTORY 16 && Folder or directory. Attribute is read-only.
>#DEFINE FA_ALIAS 1024 && Link or shortcut. Attribute is read-only.
>#DEFINE FA_COMPRESSED 2048 && Compressed file. Attribute is read-only.
>
>
>oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>oFile = oFSO.GetFile(lcFilename)
>
>*-----------------------------*
>* Turn off the read-only flag *
>*-----------------------------*
>oFile.Attributes = BITAND(oFile.Attributes, BITNOT(FA_READONLY))
>
>*-------------------------------------------------------------------*
>* Display status of the read-only flag *
>* ? IIF( BITAND( oFile.Attributes, FA_READONLY) > 0, "RO", "RW") *
>* *
>* Flip read-only flag *
>* oFile.Attributes = BITXOR(oFile.Attributes, FA_READONLY) *
>* *
>* Turn on the read-only flag *
>* oFile.Attributes = BITOR(oFile.Attributes, FA_READONLY) *
>*-------------------------------------------------------------------*
>
>
>....if its the table that's read-only for some reason then maybe since you're doing that PACK you still have exclusive use of it and need to close and re-open it??


Yeah, we tried this to no avail. The errors are random and we would have to do this to every table being opened, and it did not work for the files we knew it to happen to.

Thanks!!!
Tommy
Tommy Tillman A+ NetWork+ MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform