sx_BlobToFile

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_BlobToFile

VB Declaration

Declare Function sx_BlobToFile Lib "Apollo9.dll"

(ByVal cpFieldName As String,  

ByVal cpFilename As String)

As Integer

C Declaration

SHORT FAR PASCAL sx_BlobToFile

(BYTEP cpFieldname,

BYTEP cpFilename);

Description

Writes a BLOB stored in a memo file directly to a new disk file. If a file of the same name exists, it is overwritten without warning.

Return Value

Return value is (TRUE -1) if the file was created and written correctly or (FALSE 0) if anything goes wrong (e.g., invalid field name, etc.). The file will not exist if the return is False.

VB Example

' Stores a disk file to a MEMO field as a BLOB

sx_AppendBlank

sx_Replace "NoteS", R_BLOBFILE, ByVal "c:\info\readme.wri"

MsgBox "Replaced " & sx_RecNo

 

' Writes the BLOB from the MEMO field back to the disk

If not sx_BlobToFile("NoteS", "c:\info\readme2.wri") then

MsgBox "Blob file write failed"

Else

MsgBox "Blob file write succeeded"

End If

C Example

if (sx_BlobToFile("notes", "c:\zip\blobtest.blb"))

AfxMessageBox("Blob file write failed");

See Also

sx_Replace