Show pictures

  • Thread starter Thread starter SergioBS
  • Start date Start date
S

SergioBS

Hi everybody!

I have a problem with Access... I'd like to add to a database list that
contains details on used cars a picture showing the car...

I create a field OLE Object and I added the object as image, but the maximum
I can get in a report is an icon with the name of the file.
If the image is BMP I can see a small B/W picture of the real image...

Surely I made something wrong but I do not know what.. I can send the small
db to show what I've done...

Thank you!

Sergio
 
hi,
First of all, it is not wise to put images in the db. it
causes file blote. for ever 1kb of image, this adds about
1mb of size to the db. instead you should keep the images
in a special folder maybe in the same folder as your db.
in your db but the file path to the image. then use an
images control. to change images simply change the image
controls picture property to the new file path. i do this
with dlookup usually.
 
hi,
First of all, it is not wise to put images in the db. it
causes file blote. for ever 1kb of image, this adds about
1mb of size to the db. instead you should keep the images
in a special folder maybe in the same folder as your db.
in your db but the file path to the image. then use an
images control. to change images simply change the image
controls picture property to the new file path. i do this
with dlookup usually.


Hi!

Thank you for the hints.. in some way I've done it and it works but, my
problem is to set the path to put in the field:
I explain: now I indicate in the link field something like
D:\T1\db\Image\image1.jpg
D:\T1\db\Image\image2.jpg
and so on...
Problem arise if I need to move the db directory... on another Hard disk or
on another computer with different configuration:
therefore I'd like to write something like
/image/image1.jpg to make it independent from the rest of the path...
I tried to use the above notation (also ..\image\image1.jpg) but it does'nt
work.. how should I do?

Thank you!

Sergio
 
hi again,
sorry i took so long to get back to you.
you can do that programaticly.
to change the file path:
Do a make table query selecting the record id and the
filepath into a temp table. in the temp table with only
the filepath and record id, do an update query and
truncate the filepath off of the image name.

UPDATE tmptbl SET tmptbl.filepath = Right([tmptbl],9);

where 9 would be the number of characters in the filepath
you want to change.
this would leave you with only the record id and the image
name in the temp table.
next do an up date query that will update your real table
with the new filepath.

UPDATE realtbl INNER JOIN realtbl ON temptbl.Id =
realtbl.Id SET realtbl.filepath = "S:\" & [temptbl].
[filepath];

where s:\ is the new file path and temptbl.filepath is the
image name.
may seem like a lot but it is rather simple.
hope this helps.
good luck
-----Original Message-----

<[email protected]> ha scritto nel messaggio


Hi!

Thank you for the hints.. in some way I've done it and it works but, my
problem is to set the path to put in the field:
I explain: now I indicate in the link field something like
D:\T1\db\Image\image1.jpg
D:\T1\db\Image\image2.jpg
and so on...
Problem arise if I need to move the db directory... on another Hard disk or
on another computer with different configuration:
therefore I'd like to write something like
/image/image1.jpg to make it independent from the rest of the path...
I tried to use the above notation
(also ..\image\image1.jpg) but it does'nt
 
Well...thank you.. at first trial I've not successed...but I'll try again...

Thank you!

Sergio
hi again,
sorry i took so long to get back to you.
you can do that programaticly.
to change the file path:
Do a make table query selecting the record id and the
filepath into a temp table. in the temp table with only
the filepath and record id, do an update query and
truncate the filepath off of the image name.

UPDATE tmptbl SET tmptbl.filepath = Right([tmptbl],9);

where 9 would be the number of characters in the filepath
you want to change.
this would leave you with only the record id and the image
name in the temp table.
next do an up date query that will update your real table
with the new filepath.

UPDATE realtbl INNER JOIN realtbl ON temptbl.Id =
realtbl.Id SET realtbl.filepath = "S:\" & [temptbl].
[filepath];

where s:\ is the new file path and temptbl.filepath is the
image name.
may seem like a lot but it is rather simple.
hope this helps.
good luck
-----Original Message-----

<[email protected]> ha scritto nel messaggio


Hi!

Thank you for the hints.. in some way I've done it and it works but, my
problem is to set the path to put in the field:
I explain: now I indicate in the link field something like
D:\T1\db\Image\image1.jpg
D:\T1\db\Image\image2.jpg
and so on...
Problem arise if I need to move the db directory... on another Hard disk or
on another computer with different configuration:
therefore I'd like to write something like
/image/image1.jpg to make it independent from the rest of the path...
I tried to use the above notation
(also ..\image\image1.jpg) but it does'nt
work.. how should I do?

Thank you!

Sergio


.
 
Back
Top