X
Xcite
Guest
When inserting images in a database for later view in Reports, often the best solution is to write the file pathname in the database and add a simple command in VB (Visual Basic) so that the images are loaded in the report according to each specific element in the database.
To accomplish this I used the following code in VB:
Private Sub Detalhe_Format(Cancel As Integer, FormatCount As Integer)
Me![Name of the image control in the Report Design mode].Picture = Me![Database row name – includes the file pathname]
End Sub
The other solution is to embed the image in the database itself.
As most of you know, the embedding procedure increases the database size at an exponential rate (the exact rate is unknown to me but the more images you add the bigger the database file).
The first solution is best because the database file size tends to be small.
What I found out was that the above is true but only to a certain point. My database contains several hundreds of entries. All with a specific image file pathname. When previewing or attempting to print, Access tries to load up all the information into the memory. The result is a memory overflow (my memory specs: 1 GB hardware + 1 GB Virtual).
Before using the file pathname method, I add the images embedded in the database and even though the file size was huge (400 MB) there was no problem in previewing or printing (it never ate up all my memory).
So now I have a small file size database that I can’t fully preview and to print I have to do it a few (hundred) pages at a time.
I wonder if the problem lies in the VB code. Maybe its Access itself. I don’t know.
If anyone knows a workaround I would appreciate the input.
Thanks.

To accomplish this I used the following code in VB:
Private Sub Detalhe_Format(Cancel As Integer, FormatCount As Integer)
Me![Name of the image control in the Report Design mode].Picture = Me![Database row name – includes the file pathname]
End Sub

The other solution is to embed the image in the database itself.

As most of you know, the embedding procedure increases the database size at an exponential rate (the exact rate is unknown to me but the more images you add the bigger the database file).

The first solution is best because the database file size tends to be small.

What I found out was that the above is true but only to a certain point. My database contains several hundreds of entries. All with a specific image file pathname. When previewing or attempting to print, Access tries to load up all the information into the memory. The result is a memory overflow (my memory specs: 1 GB hardware + 1 GB Virtual).

Before using the file pathname method, I add the images embedded in the database and even though the file size was huge (400 MB) there was no problem in previewing or printing (it never ate up all my memory).

So now I have a small file size database that I can’t fully preview and to print I have to do it a few (hundred) pages at a time.

I wonder if the problem lies in the VB code. Maybe its Access itself. I don’t know.

If anyone knows a workaround I would appreciate the input.
Thanks.
