Switch to: V9V8V7V6V5

VBLOB Class: Value Methods

VBLOB.DeleteData()

Declaration:

DeleteData()

Description:

Deletes BLOB data of the field.

Note: After this function you must Update() the record of a Table to store a new reference to the BLOB record in the table.

This method is useful if you want to delete BLOB data, but you do not want to delete records.

Example:

fldBLOB.DeleteData()
curs.UpdateRecord()

VBLOB.ReadData()

Declaration:

ReadData as String

Description:

Read value of BLOB and return it as string (note that a REALbasic String can hold binary data).

Example:

dim blobValue as String
blobValue = fldBLOB.readData()

VBLOB.WriteData()

Declaration:

WriteData( inData as String )

Parameters:

  • inData - The binary data to be stored in the BLOB field.

Description:

These methods allow you to store in the BLOB field any raw data using REALbasic String.

Example:

dim s1 as String 
s1 = “aaaaaa”				// 6 chars
 
// if we going do AddRecord() for cursor or table 
// we must call SetBlank() first of all.
tbl.SetBlank() 
  fld_blob.WriteData( s1 )
tbl.AddRecord()

VBLOB.FromFile()

Declaration:

FromFile( inLocation as Folderitem )

Parameters:

  • inLocation - A location of the file.

Description:

Reads the whole file into the BLOB field.

Example:

fldBLOB.FromFile( location )
tbl.AddRecord()

VBLOB.ToFile()

Declaration:

ToFile( inLocation as Folderitem )

Parameters:

  • inLocation - A location of the file.

Description:

Uploads the value of BLOB field of the current record into a new disk file, specified by parameter inLocation.

Example:

fldBLOB.ToFile( location )