Hi killerlince,
For using the Attachment data type it (any document, image, etc), needs to be uploaded from the UI of Access and not from the SQL query. Since you are accessing via Blue Prism you can read about other issues that you may face here -
https://www.cimaware.com/expert-zone/working-with-attachment-data-type-in-microsoft-access
There is an OLE Object datatype which can be used to store images in that field.
But a direct image cannot be stored. It has to be first converted to its corresponding binary data and then stored. Also the binary data has to be converted back to the original image while fetching the data back from the database.
You will have to write a code stage to achieve this functionality which you can do by taking pointers from the below link.
http://djjeavons.com/read-write-images-access-ole-object-field/
Using the above approach may have the possibilities to make your Access database larger depending on the number of records with images you have.
A better approach would be the one that you are thinking of. To store the image as a file on some path and then saving the path to the database. The below Code stage will help you achieve that.
Code:
Try
FullSavedImagePath = OutputFolderPath & Format(now, "dd-MMM-yy hh-mm-ss") & ".jpeg"
ImageToRead.Save(FullSavedImagePath, System.Drawing.Imaging.ImageFormat.jpeg)
Success = True
Catch e As Exception
Success = False
Message = e.Message
Finally
End Try
Overall Object Diagram:
Input Properties for Code stage:
Output Properties for Code stage:
Start stage properties:
End stage properties:
For any reference or namespace issues also take a look at
this link.
- Pass the Image data item (which you already have) from the Process to this Object.
- Also pass the path where you want to store the resulting file.
- After running the process you will find the image stored as a separate file on the path that you passed in OutputFolderPath.