Click or drag to resize

DbServer.BLOBExport Method (Usual, String, Long)

X#
Copy the contents of a BLOB, identified by its memo field number, to a file.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD BLOBExport(
	uField AS USUAL,
	cTarget AS STRING,
	 kMode AS LONG
) AS LOGIC
Request Example View Source

Parameters

uField
Type: Usual
The name, number, or symbol representing the position of the field in the database file structure.
cTarget
Type: String
The file to which the records is copied.
kMode
Type: Long
A constant defining the copy mode, as shown in the table below:
ConstantDescription
BLOB_EXPORT_APPEND Appends to the file
BLOB_EXPORT_OVERWRITE Overwrites the file—this is the default

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Examples
This example exports the contents of a field that stores a picture to a .GIF file, so that the file can be programmatically displayed:
X#
 1FUNCTION ShowPix()
 2LOCAL cPixFile := "picture.gif" AS STRING
 3LOCAL nPos
 4LOCAL oDBCust AS DBServer
 5// Customer database with a picture of each     // customer stored in a field called Pix
 6oDBCust := Customer{}
 7nPos := oDBCust:FieldPos("Pix")
 8// Export the BLOB file's data
 9// for the current Pix field
10IF !oDBCust:BLOBExport(nPos, cPixFile, ;
11BLOB_EXPORT_OVERWRITE)
12Alert("Export of picture " + cPixFile + " failed!")
13ELSE
14// Code for displaying picture would go here
15ENDIF
See Also