Microsoft KB Archive/31151

= &quot;Path/File Access Error&quot;; OPEN FOR APPEND ACCESS WRITE =

Article ID: 31151

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q31151



SUMMARY
A &quot;path/file access error&quot; message occurs when OPENing with FOR APPEND ACCESS WRITE.

The error occurs because the designated file needs to be READ in order to be APPENDed. If the file is OPENed with ACCESS WRITE, READing privileges have not been provided.

To eliminate the error message, omit the ACCESS clause or change ACCESS WRITE to ACCESS READ WRITE.

This information also applies to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2 and to Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.

The following code example demonstrates this behavior: OPEN &quot;test1.dat&quot; FOR APPEND ACCESS WRITE as #1  ' Incorrect. ' OPEN &quot;test1.dat&quot; FOR APPEND ACCESS READ WRITE as #1  ' Correct. FOR k = 1 TO 100

WRITE #1, &quot;hello&quot;, k

NEXT k close #1

Additional query words: QuickBas BasicCom

Keywords: KB31151

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.