Bound Object Frame (Resize Images in Field) (1 Viewer)

RichardFM

New member
Local time
Yesterday, 20:11
Joined
Sep 2, 2011
Messages
1
Hi all,

I have been doing database programming for many years, but I am new to Access programming. I have just been assigned the task of resizing images in an SQL Server database, which is populated from an Access project.

The database is over 300GB (yes, that's Gigabytes), with nearly all of it being used by a single field of type "OLE Object" (Access), and Image (SQL Server).

The Access program uses a Bound Object Frame (BOF) to read/write the field. Most, if not all, of the data is added by pasting the contents of the Windows clipboard into the BOF control. (The users screen-copy snippets of emails and other imaged documents into this program.)

Most of the images are only a few hundred KB in size (as they are low resolution and B&W). But recently, these images have been getting pasted in higher resolution and in color. These later images, of which there are about 30,000, are upwards of 5MB and need to be resized to increase retrieval/display speed, and decrease database size.

I've spent the last 2 days trying to determine the format of the images in the field itself. I can easily extract the field data to an image file, have the image resized and then import the data back in the database, overwriting the current contents.

My problem is that I haven't been able to figure out the file format of the data. I realize that the data didn't come from a file, as it was pasted from the clipboard, but since clipboard image data is BMP/DBI, I assume the data is that as well. I suspect that the data is in that format, but has some OLE header information, which would need to be stripped in order to save it as graphic file (and then re-appended when saving back to the database).

I looked through the help on the BOF control, but did not see any method to save the data to a file (hopefully stripping the OLE information). I also looked for Table and Field objects, in the hope that they may have such a method.

After reading a lot of information about this online, nearly everyone recommends against BOF for images due to bloat. It appears that using an Image control is a better way to go. Assuming this allows pasting form the clipboard (and if not I'm assuming I can use VBA to trap the CTRL-V key sequence and then manually write the clipboard data to the Image control), then converting the image data in every row to jpg/bmp, or some other easily exportable format, will be a better solution.

The export and import doesn't need to be done in Access, but can be if needed.

All help and suggestions are greatly appreciated.
 

Users who are viewing this thread

Top Bottom