Re: Storing and displaying pictures with MS Access -D7



"Jacques" <jacques.noah@xxxxxxxxxxxxxx> wrote in message
news:42739bc1@xxxxxxxxxxxxxxxxxxxxxxxxx
> Does anyone one know how to store and retrieve pictures(jpg,bmp etc) in a
> Access database? I tried to follow a tutorial on it at
> http://delphi.about.com but that example does not seem to work.
>
> Can anyone help?
> Thanks
Keith makes a valid point and for many images, we also use the same system
of just storing filenames in the database. If you only want to work with
smallish images, I suggest that you access the blob field using the
savetostream / loadfromstream methods. Use these to then load your visual
image component.
eg: TBlobField(MyDB.FieldByName('images')).SaveToStream(ms) //ms is a
temporary TMemoryStream
then load the image from ms:

ms.position:=0;
theimageobject.LoadFromStream(ms);

Alternatively, you can use TBlobStreams to load/save info into the blobfield
eg:

bs: TBlobStream;

bs:=MyDB.CreateBlobStream(MyDB.FieldByName('images'),bmRead);
theimageobject.LoadFromStream(bs);

Check out Delphi help for some of the caveats when using TBlobStreams

HTH

Andrew


.



Relevant Pages

  • Re: Resume Database and PDFs
    ... have been put in charge of creating an MS Access database for the Resume's my ... it's best NOT to store graphical images in ... path and filename in a Text or Hyperlink field in your table. ...
    (microsoft.public.access.formscoding)
  • Re: Image Comparison/Histogram
    ... usually it's not a good idea to store images in an Access database. ... If you embed them as OLE objects, they are stored very inefficiently, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Automating picture import in Access
    ... storing large numbers of images in OLE fields in an Access database is ... >the tests of 100 detectors for high-energy nuclear physics. ... >I need to enter about 150 pictures and/or files for each detector. ...
    (microsoft.public.access.externaldata)
  • Re: Looking for people who have built document scanning/retrieval into an Access database
    ... them and then make them accessible from an Access database. ... And NO I am not planning to store the scanned images in the Access ... Use a document scanner that can put the documents in a directory with a ... the document by client/consumer and type of document. ...
    (comp.databases.ms-access)