Click or drag to resize

DbServer.BLOBExport Method

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

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.7
	uField AS USUAL := NIL,
	oFSTarget AS USUAL := NIL,
	kMode AS USUAL := NIL
Request Example View Source


uField (Optional)
Type: Usual
The name, number, or symbol representing the position of the field in the database file structure.
oFSTarget (Optional)
Type: Usual
The name of the target file where the BLOB data will be written, including an optional drive, directory, and extension.   See SetDefault() and SetPath() for file searching and creation rules.  No default extension is assumed. If <oFSTargetFile> does not exist, it is created.  If it exists, this method attempts to open the file in exclusive mode and, if successful, the file is written to without warning or error.  If access is denied because, for example, another process is using the file, NetErr() is set to TRUE and the data server's Status property is set.  
kMode (Optional)
Type: Usual
A constant defining the copy mode, as shown in the table below:
          Constant				Description
          BLOB_EXPORT_APPEND	Appends to the file
          BLOB_EXPORT_OVERWRITE	Overwrites the file — this is the default

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
This example exports the contents of a field that stores a picture to a .GIF file, so that the file can be programmatically displayed:
 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, ;
12Alert("Export of picture " + cPixFile + " failed!")
14// Code for displaying picture would go here
See Also