DbiFreeBlob

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiFreeBlob

Return to chapter overview

C syntax

DBIResult DBIFN DbiFreeBlob (hCursor, pRecBuf, iField);

Delphi syntax

function DbiFreeBlob (hCursor: hDBICur; pRecBuf: Pointer; iField: Word): DBIResult stdcall;

Description

DbiFreeBlob closes the BLOB handle obtained by DbiOpenBlob. The BLOB handle is located within the specified record buffer.

Parameters

hCursor                Type: hDBICur                (Input)
Specifies the cursor handle for the table. The table must contain a BLOB field.

pRecBuf                Type: pBYTE                (Input)
Specifies the pointer to the record buffer containing the BLOB handle. DbiOpenBlob sets the BLOB handle in the record buffer.

iField                Type: UINT16                (Input)
Specifies the valid field number of the open BLOB field. If set to 0, the DbiFreeBlob call closes all open BLOBs associated with the record buffer.

Usage

The BLOB handle is closed, and all resources allocated to the BLOB with DbiOpenBlob are released.

This function must be called after calling DbiModifyRecord, DbiInsertRecord, or DbiAppendRecord (only if a BLOB has been opened), in order to free BLOB resources. DbiModifyRecord, DbiInsertRecord, or DbiAppendRecord do not automatically release BLOB resources after record modification. However, if DbiFreeBlob is called prior to calling DbiModifyRecord, DbiInsertRecord, or DbiAppendRecord, then any changes made to the BLOB are lost.

This function does not affect the contents of the BLOB on disk.

Prerequisites

The current record buffer must contain a BLOB field, and the BLOB must have been opened with DbiOpenBlob.

Completion state

After a BLOB handle has been freed, subsequent calls to DbiFreeBlob for the same handle result in an error.

DbiResult

Meaning

DBIERR_NONE

The BLOB field was freed successfully.

DBIERR_INVALIDHNDL

The specified cursor handle is invalid or NULL.

DBIERR_INVALIDPARAM

The specified record buffer is NULL.

DBIERR_OUTOFRANGE

The number specified in iField is greater than the number of fields in the table.

DBIERR_BLOBNOTOPENED

The specified BLOB field has not been opened via a call to DbiOpenBlob. This error is returned if the BLOB has already been freed with a previous DbiFreeBlob call.

DBIERR_INVALIDBLOBHANDLE

The logical BLOB handle in the record buffer is invalid.

DBIERR_NOTABLOB

The specified field number does not correspond to a BLOB field.

See also

DbiOpenTable, DbiOpenBlob, DbiPutBlob, DbiTruncateBlob, DbiGetBlob, DbiGetBlobSize, DbiInsertRecord, DbiAppendRecord, DbiModifyRecord