PdcDBTable.GetFile: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == GetFile(FieldName as String,FileName as String) as Boolean == Description == Gets a file from the database and stores it on disk, returns true or false whet..."
 
No edit summary
 
Line 19: Line 19:
   if objTable.Locate("AT_ORDNR", "00001") then
   if objTable.Locate("AT_ORDNR", "00001") then
       filename = objTable.GetField("AT_FILE")
       filename = objTable.GetField("AT_FILE")
       objTable.GetFile("AT_BIN", filename)
       objTable.GetFile "AT_BIN", filename
   end if
   end if
end if
end if

Latest revision as of 05:55, 4 October 2013

Declaration

GetFile(FieldName as String,FileName as String) as Boolean

Description

Gets a file from the database and stores it on disk, returns true or false wheter the process is succeeded

Notes

This method will store the file in the database on disk in the given filename.

Code example

This code example extracts the attachment from Calculation 00001 from the table.

Dim objTable
dim filename

Set objTable = pdc.Database.OpenTable(pdcConData, "ATTACH","AT_ORDNR")
if IsValid(objTable) then
   if objTable.Locate("AT_ORDNR", "00001") then
      filename = objTable.GetField("AT_FILE")
      objTable.GetFile "AT_BIN", filename
   end if
end if
set objTable = nothing

Availability

Available since September 2008 (from version 3.8)