Click or drag to resize

DbServer.BLOBRootGet Method

Retrieve the data from the root area of a BLOB file.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.5
Syntax
 VIRTUAL METHOD BLOBRootGet() AS USUAL

Return Value

Type: Usual
The data retrieved from the root of 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.  Note that DBServer:BLOBRootGet() returns NIL if the root reference has never been written to with DBServer:BLOBRootPut().
Remarks
DBServer:BLOBRootGet() allows the retrieval of a BLOB from the root of a BLOB file.
Tip Tip
Because the root data does not reference a particular record in the data server, it is not affected by DBServer:RLock(), nor is it subject to the DataServer:ConcurrencyControl settings.  Therefore, if the data server is opened in shared mode, you should use DBServer:BLOBRootLock() before calling DBServer:BLOBRootGet().
Examples
This example uses DBServer:BLOBRootGet() to read system settings from a BLOB file into an array, then demonstrates how to allow the user to modify the settings are restore them in the BLOB file:
X#
 1FUNCTION UpdateSettings()
 2LOCAL aSettings AS ARRAY
 3LOCAL oDBCust AS DBServer
 4oDBCust := Customer{}
 5IF oDBCust:BLOBRootLock()
 6// Get any existing settings
 7aSettings := oDBCust:BLOBRootGet()
 8IF Empty(aSettings)
 9// This method would populate aSettings
10// with default data
11aSettings := oDBCust:GetDefaultSettings()
12ENDIF
13// This method would allow the user to
14// modify the settings.
15IF oDBCust:ModifySettings(aSettings)
16// Finally, store the settings
17oDBCust:BLOBRootPut(aSettings)
18ENDIF
19oDBCust:BLOBRootUnlock()
20ELSE
21aSettings := {}
22Alert("Could not obtain a lock on the root")
23ENDIF
24oDBCust:Close()
25RETURN aSettings
See Also