DAOpenFileReadOnlyA

Document management, Direct access functionality

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to DAOpenFileReadOnly and string arguments are interpreted using the current SetAnsiMode code page

Opens a file in direct access mode. This allows large files to be processed. The file is opened with read only access so other processes will also be able to open the file in read only mode.

DASaveAsFile should be used to save any changes to a new file as DAAppendFile cannot update read only files.

Syntax

Delphi

Function DLDAOpenFileReadOnlyA(InstanceID: Integer; InputFileName, Password: PAnsiChar): Integer;

DLL

int DLDAOpenFileReadOnlyA(int InstanceID, const char* InputFileName, const char* Password);

Parameters

InputFileNameThe path and name of the document to open in direct access mode with read-only access.
PasswordThe password to use when opening the document. This can be the owner or user password. If the user password is used certain functionality may be restricted depending on the permissions of the document.

Return values

0The file could not be opened. Use the LastErrorCode function to determine the cause of the failure.
Non-zeroA FileHandle that can be used with the other Direct Access functions