Display Base64 image string in MS Access Report/Form - ms-access

I have a Client that is using MS Access, I need to be able to convert a Base64 String representation of a Bitmap image, so that it can be displayed in an MS Access Report.
I know how to do this is C# etc, but don't know where to start with Access...

The best solution may be to use an external program:
make your own in C# as you know how to do
if you just want to display it you can do it with the user's browser

Related

Insert image into Crystal Report using base64 string

I have a base64 encoded image stored in my database as a blob, and I want to insert it into a Crystal Report without a fileupload field. I looked all around the internet and can only find ways with a file upload field.
I read somewhere that you need to load a binary code in sql if you want to display an image.
So I have a binary code in MSSQL/MySQL server with varbinary(max) that I load into the crystal report, but the image is still not showing. I do see that it's an image though because I see the red X.
Should I still convert the binary value that I have from sql server to something? Is what I'm trying to do even possible? If so, please describe the way to do it.

MS access: how to embed JPEG images and preview them?

I use Access 2007
I have created an OLE field to store JPEG, so I can easily drag them into DATABASE.
That works. Trouble is: This field does not dispaly the JPEG but the generic JPEG thumb and I need to double click to open the JPEG and preview it.
Is there a way to preview JPEG without having to double click on it ?
regards
Have you considered storing your images entries for your database as 'text', and simply store the path for the image(//pics/mypic.jpg), rather than the image object itself? If your database is on a shared drive, you can create a folder in the same folder as your database to hold your images. When inserting an image, you can have a textbox and simply type the relative path to that image. This will prevent your database from inflating in size. From there, it is just some simple code to display the picture.
After setting your database up to just store the path names of the images, you can follow these easy instructions on how to display these images on forms : Microsoft Knowledge Base
I recently switched a couple of my databases from using OLE's to text fields with the path name of the picture and am really satisfied with it.
You will need to use an Attachment data type to display anything other than bmps. Only bmp images will display in an OLE field (see the Northwind sample database for an example, the Employee form shows bmp images stored in an OLE field).
Alternatively, you can store the path to the image and show it in your form with some VBA. In general, it is best to store paths to images, rather than images, even with databases that have much higher size limits.

How to extract images from Access CommandButton?

I have an Access database that I am working on, and need to extract the images from a few CommandButtons on a Form and save the images as files.
I haven't been able to do this using VBA. Anyone done this before or know how to do this?
I've used some of the Access built-in images, by using a simple graphics program to capture the screen image, then saving it to whatever format you require (eg bmp etc).

Extract OLE object containg images using VBscript

An OLE Object column contains images but the image type (jpg/gif/tiff) is unknown. These images need to be extracted from the DB and saved to disk using VBscirpt.
I've done this before in Delphi, the solution was to use the clipboard (somehow the clipboard can determine the type of image). Copy the contents of the field to the clipboard and then save the contents of the clipboard to a file.
OLE objects is bad way of storing images in MS Access. Use OLEToDisk to save your images as pic files.
After that reimport them in nice way. Check AccessImagine for working with images in Access - it does all the hard job.
Here I found an example to take a screenshot with VBScript and paste it to MS Paint. Maybe you can modify it to do what you want?
http://hisudhakar.spaces.live.com/blog/cns!8DDF980C45482279!410.entry?sa=948299040

Storing PDFs in MS Access Database using Forms

I need to store PDF files in an Access database on a shared drive using a form. I figured out how to do this in tables (using the OLE Object field, then just drag-and-drop) but I would like to do this on a Form that has a Save button. Clicking the save button would store the file (not just a link) in the database. Any ideas on how to do this?
EDIT:
I am using Access 2003, and the DB will be stored on a share drive, so I'm not sure linking to the files will solve the problem.
We have several databases that contain 10's of thousands of documents (pdf, doc, jpg, ...), no problem at all. In Access, we use the following code to upload a binary object to a binary field:
Function LoadFileFromDisk(Bestand, Optional FileName As String = "")
Dim imgByte() As Byte
If FileName = "" Then FileName = strFileName
Open FileName For Binary Lock Read As #1
ReDim imgByte(1 To LOF(1))
Get #1, , imgByte
Close #1
If Not IsEmpty(imgByte) Then Bestand.Value = imgByte
End Function
In this case, Bestand is the field that contains the binary data.
We use MS SQL Server as a backend, but the same should work on an Access backend.
If you used the same concept but upsized to SQL Server- storing PDFs inside of an Image datatype (or varbinary(max)) then you could SEARCH INSIDE THE PDFs using Full Text Search.
I show that Microsoft says you can do this for any file type where you can register an IFILTER product.. and I just was at the Adobe website the other day and say that their Acrobat IFILTER is indeed FREE.
Maybe this will help: ACC2000: Reading, Storing, and Writing Binary Large Objects (BLOBs).
What they do: Read a file in chunks and add it to a blob using a VBA function.
A field of OLE Object, by default would use a Bound Object Frame on the form. Right click on it and you can Insert an object. It comes complete with browsing for the file. Double-click on the field and the actual document will open.
I recommend going with David's advice and link. Unless you have a need to transfer a single file and want all the PDF's included. Size and performance will be an issue.
If security is an issue and the Access file is the only control you have (You are unable to set security on the folder containing all the linked files.), then you would have to embed.