PdcDBTable.PutFile: Difference between revisions
Jump to navigation
Jump to search
Created page with "== 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 proce..." |
No edit summary |
||
Line 18: | Line 18: | ||
if IsValid(objTable) then | if IsValid(objTable) then | ||
if objTable.Locate("AT_ORDNR", "00001") then | if objTable.Locate("AT_ORDNR", "00001") then | ||
filename = "C:.txt" | filename = "C:\temp\filename.txt" | ||
if objTable.EditRecord then | if objTable.EditRecord then | ||
objTable.SetField "AT_FILE", filename | objTable.SetField "AT_FILE", filename |
Latest revision as of 05:56, 4 October 2013
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)