Re: Load Picture from MS Access to VB6
- From: "The Merg" <howard_mergler@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 1 Dec 2005 09:43:26 -0500
Most likely it will only be accessed by one person at a time. I've also put
in code to compact the database via a menu option. As for not storing the
pic and only linking to the original by storing the path, I'm a little outta
luck there. The photos being used are on one computer in particular and the
path to them might not always be the same depending on where the app is
being run from. Also, there is a chance the filename of the photo itself can
change, which of course would break the link to the photo in the
application.
Thanks again for the help.
- The Merg
--
Today's problems don't worry me,
I haven't solved yesterday's yet.
"Paul Clement" <UseAdddressAtEndofMessage@xxxxxxxxxxxxxx> wrote in message
news:otvto1he6sobo35jcro6n0epqrh6v1no0f@xxxxxxxxxx
> On Wed, 30 Nov 2005 14:13:50 -0500, "The Merg"
> <howard_mergler@xxxxxxxxxxxxxxxxxx> wrote:
>
> ¤ Well, I figured it out I think. My problem was stemming from the fact
> that I
> ¤ loaded images into the database directly through Access (so that I could
> ¤ have some initial data to play with). When I inserted the image into
> Access
> ¤ that way, it stored it as a Microsoft Photo v3.0 object. When VB was
> trying
> ¤ to pull that object into the ImageBox, it failed of course. As soon as I
> ¤ removed all the images from Access and then loaded images onto my form
> and
> ¤ had VB save them to the database, everything started working fine.
> ¤
> ¤ Of course, now the issue is that graphics are very large when stored in
> an
> ¤ Access database, but I guess I'll have to live with that.
> ¤
> ¤ Thanks for your help. Your message caused me to look at things from the
> ¤ Access end where the issue was actually caused from.
> ¤
> ¤ As far as how I'm displaying the pictures in VB--pretty simple. I have
> an
> ¤ ImageBox inside a PictureBox. The ImageBox is connected to a DAO object
> with
> ¤ it's DataField property pointing to the Photo (OLE Object) field in the
> ¤ Access database. No code used for the retrieval or saving. I only have
> code
> ¤ to help resize the photo once it's been retrieved. If you want that I
> can
> ¤ post it for you (although I stole it from this newsgroup to begin with).
>
> OK, so it sounds like the images are no longer *stored* as OLE Object data
> (w/the OLE header)
> because otherwise you couldn't bind directly to the data source using the
> Image control.
>
> If you just *stream* the binary data from the file and save it into an OLE
> Object column (without
> using the native application associated with the file type) then you
> should be able to bind
> directly to the Image control from your data source. That is what it
> sounds like you have done.
>
> I don't believe there is anything you can do concerning the size of the
> binary stream. Not unless
> there is a third party replacement for the Image control which can do
> this. I know it's convenient
> with respect to database portability to be able to store your images to
> the database, but the
> recommended method is to store only the file path and load the file from
> the file system instead.
>
> BTW, keep an eye on the size of your database and compact regularly -
> especially if the database
> will be accessed concurrently by other users.
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
.
- References:
- Re: Load Picture from MS Access to VB6
- From: Paul Clement
- Re: Load Picture from MS Access to VB6
- From: The Merg
- Re: Load Picture from MS Access to VB6
- From: Paul Clement
- Re: Load Picture from MS Access to VB6
- From: The Merg
- Re: Load Picture from MS Access to VB6
- From: Paul Clement
- Re: Load Picture from MS Access to VB6
- Prev by Date: Re: need proof??? - Have the Answer..I You care.
- Next by Date: Re: Handwriting
- Previous by thread: Re: Load Picture from MS Access to VB6
- Next by thread: Re: Send attachment wiht vb6
- Index(es):
Relevant Pages
|