PdcDBQuery.GetBlobToFile: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Methods == PdcDBQuery.AffectedRows<br /> PdcDBQuery.Execute<br /> PdcDBQuery.FirstRecord<br /> PdcDBQuery.GetBlobToFile<br /> PdcDBQuery.GetField<br /> ..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Methods ==
== Declaration ==
[[PdcDBQuery.AffectedRows]]<br />
GetBlobToFile(FieldName as String, FilePath as string) as boolean
[[PdcDBQuery.Execute]]<br />
[[PdcDBQuery.FirstRecord]]<br />
[[PdcDBQuery.GetBlobToFile]]<br />
[[PdcDBQuery.GetField]]<br />
[[PdcDBQuery.LastAutoIncValue]]<br />
[[PdcDBQuery.LastRecord]]<br />
[[PdcDBQuery.NextRecord]]<br />
[[PdcDBQuery.PriorRecord]]<br />
[[PdcDBQuery.RecordCount]]<br />
[[PdcDBQuery.SetParamBool]]<br />
[[PdcDBQuery.SetParamStr]]<br />


== Properties ==
== Description ==
[[PdcDBQuery.BoF]]<br />
This method stores file in a specific record to a file on disk in an applied location.
[[PdcDBQuery.EoF]]<br />
Returns true if the file save proceed correctly.
[[PdcDBQuery.FieldNames]]<br />
[[PdcDBQuery.SQL]]


== Notes ==
== Notes ==
This property represents the query object. It makes it possible to execute SQL-statements on the database.
This method stores file in a specific record to a file on disk in an applied location.


== Availability ==  
== Code example ==
Available since September 2008 (from version 3.8)
This code example executes a SQL statement and stores a file on disk the first record.
 
<source lang="vb">
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
</source>
 
== Availability ==
Available since Mai 2019 (version 5.5 onwards)

Latest revision as of 16:22, 14 January 2021

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)