Click or drag to resize

DbServer.BLOBDirectGet Method

X#
Retrieve data stored in a BLOB file without referencing a specific field.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD BLOBDirectGet(
	nPointer,
	nStart,
	nCount
) AS USUAL CLIPPER
Request Example View Source

Parameters

nPointer (Optional)
Type: Usual
A pointer to the BLOB data. This pointer can be obtained using DBServer:BLOBDirectPut(), DBServer:BLOBDirectImport(), or DBServer:FieldInfo(DBS_BLOB_POINTER, nFieldPos).
nStart (Optional)
Type: Usual
The starting position in nPointer. If nStart is positive, the starting position is relative to the leftmost character in nPointer. If nStart is negative, it is relative to the rightmost character in nPointer. If nStart is omitted, it is assumed to be 1.
nCount (Optional)
Type: Usual
The number of bytes of data to retrieve, beginning at nStart. If nCount is larger than the amount of data stored, excess data is ignored. If omitted, DBServer:BLOBDirectGet() retrieves to the end of the data.

Return Value

Type: Usual
The data retrieved from the BLOB file. The data type of the return value depends on the actual data stored. Use ValType() or UsualType() to determine the data type.
Remarks
Tip Tip
nStart and nCount apply to string data only. They are ignored for any other data types.
DBServer:BLOBDirectGet() retrieves data stored in a BLOB file without the need to reference a particular field in the data server. It is particularly useful when accessing data that is larger than 64KB, (such as memo fields created with the BLOBImport() method).
Examples
This example illustrates storing setup information in a BLOB file, then selectively retrieving the stored information:
X#
 1FUNCTION PutSettings(aColors AS ARRAY,;
 2aPaths AS ARRAY, aPW AS ARRAY) AS VOID
 3LOCAL aSettings AS ARRAY
 4LOCAL oDBSetup AS DBServer
 5oDBSetup := Setup{}
 6aSettings := {}
 7AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aColors))
 8AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aPaths))
 9AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aPW))
10oDBSetup:BLOBRootPut(aSettings)
11oDBSetup:Close()
12FUNCTION GetColors() AS ARRAY
13LOCAL aSettings AS ARRAY
14LOCAL aColors  AS ARRAY
15LOCAL oDBSetup AS DBServer
16oDBSetup := Setup{}
17aSettings := oDBSetup:BLOBRootGet()
18aColors := oDBSetup:BLOBDirectGet(aSettings[1])
19oDBSetup:Close()
20RETURN aColors
See Also