PdcDBTable.PutFile

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

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

Description

Puts a file from disk into the database, returns true or false wheter the process is succeeded

Notes

This method makes it possible to stores files in the database. The file is taken from the given location and stored as a blob file in the table.

Code example

This code example store a file from disk in 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 = "C:\temp\filename.txt"
      if objTable.EditRecord then
         objTable.SetField "AT_FILE", filename
         objTable.PutFile "AT_BIN", filename
         objTabel.PostRecord
      end if
   end if
end if
set objTable = nothing

Availability

Available since September 2008 (from version 3.8)