Purpose
Used to determine the number of bytes the BLOB property will return.
Syntax (Read-Only
Property)
Long = object.BLOBSize
| Long
(Long) |
|
This
function returns the number of bytes that will be returned by the
BLOB property if no further changes are made to the database. |
Notes
This property returns a value between 8 and 1,147,483,647.
The
property should never return a value below 8 because if the database
is completely empty, BLOB still returns 2 longs that occupy 4 bytes
each: 1. The overall size of the BLOB in bytes and, 2. The number of
records in the database (which, in the case that no records exist, will
be 0 but will still occupy 4 bytes).
Error
Values
This property does not change the state of the ErrorNumber
property.
Example
Objective:
Store a picture from disk to a database file.
'Create the object
Dim CDP As
rtCDP.rtCompactDataPak
Set CDP = New rtCDP.rtCompactDataPak
'Get the filespec, free file number, resize the
data buffer
Dim
FileName As
String: FileName
= "C:\MyPicture.bmp"
Dim FileNumber As
Long: FileNumber
= FreeFile
Dim DataBuffer() As
Byte: ReDim DataBuffer(FileLen(FileName))
'Open the file, load the data buffer, close the
file
Open FileName For
Binary Access Read As #FileNumber
Get #FileNumber, , DataBuffer
Close #FileNumber
'Finally, transfer the picture to a new record
CDP.AppendB "Picture", DataBuffer
CDP
now has 1 record containing the picture "C:\MyPicture.bmp"
| Rec |
Key |
Data |
| 0 |
Picture |
<binary
data> |
Version
History
1.0 2/26/2001 Tested
See
Also
BLOB