FileAttr Function

Microsoft Office Access 2003

FileAttr Function

Note  The function, method, object, or property described in this topic is disabled if the Microsoft Jet Expression Service is running in sandbox mode, which prevents the evaluation of potentially unsafe expressions. For more information on sandbox mode, search for "sandbox mode" in Help.

Returns a Long representing the file mode for files opened using the Open statement.

Syntax

FileAttr(filenumber, returntype)

The FileAttr function syntax has these named arguments:

Part Description
filenumber Required; Integer. Any valid file number.
returntype Required; Integer. Number indicating the type of information to return. Specify 1 to return a value indicating the file mode. On 16-bit systems only, specify 2 to retrieve an operating system file handle. Returntype 2 is not supported in 32-bit systems and causes an error.

Return Values

When the returntype argument is 1, the following return values indicate the file access mode:

Mode Value
Input 1
Output 2
Random 4
Append 8
Binary 32