PdcDBQuery.GetBlobToFile

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

GetBlobToFile(FieldName as String, FilePath as string) as boolean

Description

This method stores file in a specific record to a file on disk in an applied location. Returns true if the file save proceed correctly.

Notes

This method stores file in a specific record to a file on disk in an applied location.

Code example

This code example executes a SQL statement and stores a file on disk the first record.

Sub sExecuteQuery
dim objQuery
dim intCnt

  set objQuery = pdc.Database.OpenQuery(pdcConData)
  objQuery.SQL = "SELECT * FROM ATTACH"

  if objQuery.Execute then
    objQuery.FirstRecord
    msgbox objQuery.GetBlobToFile("at_file", "c:\temp\Filename.pdf")
  else
    msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & objQuery.SQL
  end if
End Sub

Availability

Available since Mai 2019 (version 5.5 onwards)