PdcDBTable.PutImage: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
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 ==

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)