_BtOpen() Function

 

<< Click to Display Table of Contents >>

Navigation:  Low Level Functions >

 

_BtOpen() Function

 

Previous pageReturn to chapter overviewNext page

 

Purpose

Opens a btrieve file

 

Prototype

 

 

FUNCTION _BtOpen ( cName AS STRING, cOwner AS STRING, nMode AS SHORT, nId  := 0 AS WORD )  AS PTR

 

 

 

Argument(s)

 

 

<cName>Filename of the file to open. Can be both local or on the server
<cOwner>If the file has an owner, you must speciffy the owner name
<nMode>Open Mode (see below)

 

Return

 

 

POINTERHandle of the Opened File. This handle is returned in the Form of a Pointer. This is not a regular file handle, and the handle should only be used within the btrieve Library

 

Description

 

 

With this function you can open a file. The file MUST EXIST and be accessible. You can open the file in a number of different modes:

 

BFM_NORMAL                Shared Read-Write

BFM_ACCELERATED                File is opened a little bit faster, but file is not recovered by Roll-Back

BFM_READONLY                ReadOnly

BFM_EXCLUSIVE                Exclusive Read/Write

 

When an error occurs opening the file, the returned handle is a NULL_PTR, and the Bt_Error()function returns one of the following values:

02 I/O Error
11 Invalid Filename
12 File Not Found
20 Btrieve Not Loaded
46 Access to File Denied
84 Record Locked
85 File Locked
86 File Table Full
87 Handle Table Full
88 Incompatible Mode Error

 

 

 

 

See Also

 

 

_BtCreate(), _BtClose()