By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Handling images in a database

P: n/a
I am creating a database that will have a large number of images in it and I
would like some input as to the best way to handle them.

Each record in my database will have a one-to-many relationship with a
Pictures table, i.e. there will be several pictures for each record in my
main table.

There are several things that I would like to be able to do with this setup,
and this is what I am thinking:

I create the table 'Pictures' with the following fields...[PictureID],
[MainTableID], [PictureFile], [PictureDescription]
-PictureID is an autonumber, primary key
-MainTableID links the pictures to the Main Table
-PictureFile would be the name of the picture file that is stored in a set
directory on the hard drive. Ideally, I would like this to be only the name
of the file, i.e. picture1.jpg, picture2.jpg, etc., and not an actual path.
-Picture Description would be a text field with the pictures description in
it

There would be a form where the Main Table is the record source. On this
form would be a subform for Pictures.

The Pictures subform would have 3 item on it. The first would be a text box
for [PictureFile] where users would enter the filename. Once they leave this
field, the image that corresponds to that filename would appear in another
control. The third item would be a text box for the pictures description.
Obviously I would need some code in the OnExit event for the [PictureFile]
text box that would somehow read the image from the hard drive and show it
on the form.

I hope that I have explained this clearly, if not, just holler. Otherwise,
does this sound like an acceptable, efficient way to handle a large number
of pictures in a database? Does it sound like it can be done? Any other
thoughts or suggestions, either on doing it this way, or another way that
may be eisier or better?

Thanks,
Robert

Apr 30 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
In my opinion, it is better if you will save
the picture to the database and not the filename
only.

May 2 '06 #2

P: n/a
ar********@gmail.com wrote in news:1146545611.590503.309340
@v46g2000cwv.googlegroups.com:
In my opinion, it is better if you will save
the picture to the database and not the filename
only.


Are you with Maxtor or Western Digital?

--
Lyle Fairfield
May 2 '06 #3

P: n/a
>>arthurj...@gmail.com wrote in news:1146545611.590503.309340
@v46g2000cwv.googlegroups.com:
In my opinion, it is better if you will save
the picture to the database and not the filename
only.

Are you with Maxtor or Western Digital?


No, why?

May 2 '06 #4

P: n/a

<ar********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
arthurj...@gmail.com wrote in news:1146545611.590503.309340
@v46g2000cwv.googlegroups.com:
In my opinion, it is better if you will save
the picture to the database and not the filename
only.


Are you with Maxtor or Western Digital?


No, why?

Create an Access database, import a picture into it and see how much it
grows.

Are you with Segate instead?
May 2 '06 #5

P: n/a
ar********@gmail.com wrote in news:1146551249.018991.184210
@j33g2000cwa.googlegroups.com:
arthurj...@gmail.com wrote in news:1146545611.590503.309340
@v46g2000cwv.googlegroups.com: In my opinion, it is better if you will save
the picture to the database and not the filename
only.

Are you with Maxtor or Western Digital?


No, why?


Just a guess!

--
Lyle Fairfield
May 2 '06 #6

P: n/a
>> In my opinion, it is better if you will save
the picture to the database and not the filename
only.
Are you with Maxtor or Western Digital?


ROTFL :-)

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it
skype: pbsoftsolution
May 2 '06 #7

P: n/a
with 100 records of 50K images stored in BLOB fields,
the database grew to more than 4 MB.
The same database using file pointers instead was under 100K.

Access has 2G capacity, so, you can save 50,000 images using BLOB
and 2,000,000 images with file pointer.

Each method has advantages and disadvantages
http://msdn.microsoft.com/library/de...tml/gs0102.asp

I guess i give up my opinion.

May 2 '06 #8

ADezii
Expert 5K+
P: 8,669
I am creating a database that will have a large number of images in it and I
would like some input as to the best way to handle them.

Each record in my database will have a one-to-many relationship with a
Pictures table, i.e. there will be several pictures for each record in my
main table.

There are several things that I would like to be able to do with this setup,
and this is what I am thinking:

I create the table 'Pictures' with the following fields...[PictureID],
[MainTableID], [PictureFile], [PictureDescription]
-PictureID is an autonumber, primary key
-MainTableID links the pictures to the Main Table
-PictureFile would be the name of the picture file that is stored in a set
directory on the hard drive. Ideally, I would like this to be only the name
of the file, i.e. picture1.jpg, picture2.jpg, etc., and not an actual path.
-Picture Description would be a text field with the pictures description in
it

There would be a form where the Main Table is the record source. On this
form would be a subform for Pictures.

The Pictures subform would have 3 item on it. The first would be a text box
for [PictureFile] where users would enter the filename. Once they leave this
field, the image that corresponds to that filename would appear in another
control. The third item would be a text box for the pictures description.
Obviously I would need some code in the OnExit event for the [PictureFile]
text box that would somehow read the image from the hard drive and show it
on the form.

I hope that I have explained this clearly, if not, just holler. Otherwise,
does this sound like an acceptable, efficient way to handle a large number
of pictures in a database? Does it sound like it can be done? Any other
thoughts or suggestions, either on doing it this way, or another way that
may be eisier or better?

Thanks,
Robert
I've had a situation very similiar to yours in that I created an Inventory System that displays a Graphic Image for almost every item in Inventory. I initially stored the images internally in the form of *.jpgs but in a relatively short period of time I had to take a 360 degree shift in logic because the size of the database was getting out of hand. Within the Current() Event of the Main Inventory Form, I now load the graphic images dynamically into an Image Control using a system of Global Variables and LoadPicture(). The result was a drastic incease in efficiency and a phenomenal decrease in the size of the DB. Hope this helps....
May 3 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.