PdcDBQuery.GetBlobToFile: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
GetBlobToFile(FieldName as String, FilePath as string) as boolean | |||
== Description == | == Description == | ||
Returns the | 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 == | == Notes == | ||
This method | This method stores file in a specific record to a file on disk in an applied location. | ||
== Code example == | == Code example == | ||
This code example executes a SQL statement and | This code example executes a SQL statement and stores a file on disk the first record. | ||
<source lang="vb"> | <source lang="vb"> | ||
Line 17: | Line 18: | ||
set objQuery = pdc.Database.OpenQuery(pdcConData) | set objQuery = pdc.Database.OpenQuery(pdcConData) | ||
objQuery.SQL = "SELECT * FROM | objQuery.SQL = "SELECT * FROM ATTACH" | ||
if objQuery.Execute then | if objQuery.Execute then | ||
objQuery.FirstRecord | objQuery.FirstRecord | ||
msgbox objQuery. | msgbox objQuery.GetBlobToFile("at_file", "c:\temp\Filename.pdf") | ||
else | else | ||
msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & | msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & objQuery.SQL | ||
end if | end if | ||
End Sub | End Sub | ||
Line 29: | Line 30: | ||
== Availability == | == Availability == | ||
Available since | 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)