PdcDBQuery.GetBlobToFile: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
== | == 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 == | == Notes == | ||
This | This method stores file in a specific record to a file on disk in an applied location. | ||
== Availability == | == Code example == | ||
Available since | 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)