<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_BlobToFile |
Declare Function sx_BlobToFile Lib "Apollo9.dll"
(ByVal cpFieldName As String,
ByVal cpFilename As String)
As Integer
SHORT FAR PASCAL sx_BlobToFile
(BYTEP cpFieldname,
BYTEP cpFilename);
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 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
if (sx_BlobToFile("notes", "c:\zip\blobtest.blb"))
AfxMessageBox("Blob file write failed");