473,890 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display BLOB images in a MS Access Report?

137 New Member
Hi all,

I'm trying to create a report that displays all relevant information per record. However this includes displaying a screenshot for each record.
Images are uploaded and stored as BLOBS. I've used this method as many discussions say it is the best option, due to bloating and path issues with the other methods. However to write the code for this myself is a little outside my knowledge, so I've had to use some found on the internet and alter it accordingly.

Everything regarding uploading the file to the database is working, but my problem now is getting to files to display in a report. I've tried using everything from object frames to activeX image controls, but I fear I do not know enough about what I'm doing here to make use of them correctly. Can anyone please offer any help on how to display BLOB images in reports?

Thanks.

Adam.
Mar 7 '11
23 22337
Rabbit
12,516 Recognized Expert Moderator MVP
  1. What do you mean by it can't be used with continuous forms? Do you mean if you wanted to display the picture? Doesn't the same problem exist for trying to display the blob data in a continuous form? You would have to export the blob data into an image file and then set the property of the image control. I don't think that would work on a continuous form either.
  2. I don't see a problem with storing a relative path with the images in a folder where the database is stored.
  3. Which is why I would use a relative path. If you move the images, you would move the database with them I would assume.
  4. If the images need to be shared, then so does the database. Keep them in the same parent folder and the permissions will be inherrited.
  5. I would assume everything would be kept on the same server.
  6. See number 4.
  7. etc.
  8. Actually, it's not byte for byte. At least not according to this article by Microsoft. http://office.microsoft.com/en-us/ac...005280225.aspx. Apparently, Access will create additional bitmaps that go along with each image you store in the database. So you're storing more than just the file.
  9. I think the second half of that statement could be reasons to use a blob over storing a path. Whether or not it's enough to justify it, I don't know. I do, however, contend that there will be more bloating in Access. Not just due to the article linked above, but because Access doesn't free up unused space in the database file until you run a compact.
Mar 9 '11 #11
Adam Tippelt
137 New Member
my point was that if the user deleted the original file, unaware that it was still being used by the database, then it could cause problems.
Yes I agree that bloat isn't properly handled until the database is compacted, but surely it makes sense to try and prevent it in the first place (or at least restrict it's level of growth) instead of fixing it later?

I was under the impression that the 'creating additional bitmaps' problem comes with just straight up embedding images in an OLE Object field. This is why I mentioned bloating, as the bloating is caused by the additional creation of bitmap images.
BLOBS are stored in Binary Large Data fields, and don't create bitmap images - probably the reason why you can't just straight link BLOB images to bound object frames.

I could be wrong, but that's what I've read.


Thanks very much for the code ADezii, i'll see how I get on with it!
Mar 9 '11 #12
Rabbit
12,516 Recognized Expert Moderator MVP
Accidentally deleting of files could be a problem but so could accidentally deleting the data in the blob. I just think it's much easier to recover a deleted file than blob. Also, the user shouldn't be in that folder changing stuff anyways.

You really can't prevent bloat in Access without a compact. You said that there is bloat with the other methods like the file system method. But I don't see how there's any bloat by storing images on the file system. I imagine there's more bloat by storing it in Access.

The OLE Object field is a BLOB field. You can store byte for byte only if you do all inserts and updates through VBA coding. Otherwise, it will create the bitmaps.

How big is your data set? Access has a limit of 2000 megabytes. Assuming an average picture size of 1 megabyte and assuming you're using VBA to insert and update the BLOB data, you're looking at a maximum of 2000 records. Not counting the size existing forms, reports, other tables, etc. So if you may hit 2000 records at some point, it's not going to work.

But even assuming you only have 100 records, every time someone views the report, it has to read 100 records worth of images, write 100 files, and read those 100 files into the report.
Mar 9 '11 #13
Adam Tippelt
137 New Member
Right I've managed to successfully implement your code onto my db, and it does what it should. I do however have a couple of queries:
Should the TEMP folder not be deleted once the database is closed? In a multi user environment would it cause problems if they were deleted while a user was still using them?
Should there be any bloating or performance issues related to doing this? Just by creating the report and opening it, my database has shot up from 6188kb to 13768kb, and my whole machine was suffering from a bit of lag after doing so. Performance quickly went back to normal, but the size issue still remains, even after a compact.
Mar 9 '11 #14
Rabbit
12,516 Recognized Expert Moderator MVP
From the look of ADezii's code, once the user is finished with the pictures, it doesn't matter what happens to the temp folder and its contents because the folder will be recreated if it's not there. The pictures will be recreated each time.

If a user was looking at the report and the files get deleted, then those pictures that had not yet been rendered by the report would be missing from the report.

The lag you experienced is due to when you view the report, it has to read the blobs, write the files, and load those files into the report. The bottleneck is most likely the writing of the file. You can mitigate this using a RAID array of hard drives.

If you will be using this in a multi-user environment, I suspect there may be write conflicts if two users tries to view the report at the same time and it tries to write to the same file at the same time. One of the users will get an error.
Mar 9 '11 #15
ADezii
8,834 Recognized Expert Expert
You are quite welcome, good luck Adam, and let us know if you need anything else.
Mar 9 '11 #16
ADezii
8,834 Recognized Expert Expert
@Adam - Here is a Demo DB on BLOBs that you may find very interesting, and well as very informative in your case. The Base Code is by Alan Warren, but I made several modifications to it, and use this DB as a Template anytime I am involved in a Project that comprises BLOBs. Enjoy and have fun...
Attached Files
File Type: zip BLOBS.zip (861.7 KB, 798 views)
Mar 9 '11 #17
Adam Tippelt
137 New Member
If it's a split database would that not eliminate the conflict problem?



Thanks both for the information, and cheers for the file ADezii i'll keep that in my collection. :)
Mar 10 '11 #18
Rabbit
12,516 Recognized Expert Moderator MVP
If the database is split, and each user has the front end on their computer, then there would be no conflict. However, you indicated that there's a possibility someone else might delete the images while someone was viewing the report. This suggests that the front end will be stored on the network and shared by the users. In this case, there is the possibility of conflicts. An alternative then, is to change the code so that the image folder gets created in the user's profile folder.
Mar 10 '11 #19
Adam Tippelt
137 New Member
Thanks, but I am not looking to buy or download anything, as that is not a viable solution for the situation.
Mar 14 '11 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

6
5433
by: Robert | last post by:
Hi I searching in other groups replay but .... :-( Wy my code (print ("<P> <IMG
1
3026
by: mar10a | last post by:
I am trying to insert a .gif. file into an Access report - using Insert Picture. The original image is 8X11, but access changes the size to 4X6.5. When I change the size of the image in access is puts white border around it and does not change the actual image. Is there a setting I need to change that would allow access to import at the correct size, or do I need to use another file type besides
5
2105
by: M P | last post by:
Hi! I am currently working on a project that will migrate MS Access DB and Front End to web-base solution to reduce MS Access installation. Previously, users are using MS Access as frontend to produce customized report. I am not sure if in a web based solution, using ASP, I can display the access report as-is or by converting to pdf (server side) and display on a webpage. I'm not sure if there are builtin solution on this or I need to...
0
2484
by: SLeininger | last post by:
I get a red X when I try to import my BLOB images out of SQL server. I only have two fields 'PersonIdNo' is the key and 'Photo' is the BLOB images (jpg). Here is my page so far: <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As...
0
1737
by: keithsimpson3973 | last post by:
Does anyone know if it is possible to display the value of a date picker control on a vb6 form that the user selected on an access report? I am using vb6 to display a report selection and it has a date picker combo for the start date and another for the stop date. I would like to display those 2 dates on the header of the access report I am opening from Visual Basic 6. Thanks for any help anyone can give....
2
16699
by: smorrison64 | last post by:
I have a form that is coded to open a File Dialog boc to pick a picture to display on that particular item on a subform. My form is not based on query, but rather two separate tables (one primary, one sub). That code is working properly. How do I get that to translate to my report? I use VBA code because I use formats other than BMP for the pictures. Would basing the form on the qury that the report is based on solve the issue without...
2
2643
by: satishbeh | last post by:
I have programatically saved a picture to a table as Blob format i.e long binary format. When I linked the field to a access report, it does not print. I tried using a third partysoftware like DBPix and embedded it into the report, but it says the picture is too small. Is there any way to save a picture progmatically and display it on the report Regards, Satish Menon
0
3281
selvasoft
by: selvasoft | last post by:
Hi Please help me any one. I want solution for display multiple images from oracle database.Using JSP. here is my code for display one image from database. Please Any one give me some ideas. <%@ page import ="java.sql.*,java.util.*,java.awt.*,java.io.*" %> <%
0
2102
by: dbdb | last post by:
hi, i work with ms. access 2003 i want to display image from a folder to the report. i have read thread in http://bytes.com/topic/access/answers/191611-pictures-access-reports but that's for access 2000 i want to set my image picture property, but there is no picture property when i type "image.p " -> no picture property.
0
9829
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10836
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10926
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5856
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6064
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4683
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.