PdcDBTable.PutImage: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Declaration == PutImage(FieldName as String,FileName as String) as Boolean == Description == Puts an image from disk into the database, returns true or false wether the pr..." |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 7: | Line 7: | ||
== Notes == | == Notes == | ||
This method makes it possible to store images in the database. The image is taken from the given location and stored as a blob file in the table. | This method makes it possible to store images in the database. The image is taken from the given location and stored as a blob file in the table. | ||
If used for adding an image to a material file note that for an F-part you'll need to add it to the F-part using [[pdcCalculation.LoadImageFromFile|objFPart.LoadImageFromFile]]. | |||
== Code example == | == Code example == | ||
Line 18: | Line 19: | ||
if IsValid(objTable) then | if IsValid(objTable) then | ||
if objTable.Locate("DO_ORDNR", "00001") then | if objTable.Locate("DO_ORDNR", "00001") then | ||
filename = "C:.jpg" | filename = "C:\temp\filename.jpg" | ||
if objTable.EditRecord then | if objTable.EditRecord then | ||
objTable.PutImage "DO_IMAGE", filename | objTable.PutImage "DO_IMAGE", filename |
Latest revision as of 13:43, 8 November 2016
Declaration
PutImage(FieldName as String,FileName as String) as Boolean
Description
Puts an image from disk into the database, returns true or false wether the process has succeeded
Notes
This method makes it possible to store images in the database. The image is taken from the given location and stored as a blob file in the table. If used for adding an image to a material file note that for an F-part you'll need to add it to the F-part using objFPart.LoadImageFromFile.
Code example
This code example store the image from disk in the table.
Dim objTable
dim filename
Set objTable = pdc.Database.OpenTable(pdcConData, "DO_CALC","DO_ORDNR")
if IsValid(objTable) then
if objTable.Locate("DO_ORDNR", "00001") then
filename = "C:\temp\filename.jpg"
if objTable.EditRecord then
objTable.PutImage "DO_IMAGE", filename
objTabel.PostRecord
end if
end if
end if
set objTable = nothing
Availability
Available since September 2008 (from version 3.8)