Re: Load Picture from MS Access to VB6



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)


.



Relevant Pages

  • Re: Load Picture from MS Access to VB6
    ... ¤ Well, I figured it out I think. ... loaded images into the database directly through Access (so that I could ... had VB save them to the database, ... so it sounds like the images are no longer *stored* as OLE Object data ...
    (microsoft.public.vb.general.discussion)
  • Re: Please Help Me in Visual Basic 6.0 SP6
    ... Dim dbPath As String ... Above is my programming where in this programming, ... how can i indicate myself which one i'm gonna insert to the database. ... > ¤ solution where as somebody can help me where to start. ...
    (microsoft.public.vb.database)
  • Re: Any reason why accessing Access should slowdown?
    ... On the MSACCESS / JET OLEDB front, you responded to a query I had about the ... Declared connection to Access database using string based on Jet OLDB ... Set up recordset filter in response to earlier input / selection ... ¤ I am writing a VB6 App using an Access database backend ...
    (microsoft.public.vb.database)
  • Re: Copy database schema from Access to SQL Server
    ... It can import a JET database in a single stroke. ... Hitchhiker's Guide to Visual Studio and SQL Server ... ¤ projects to SQL Server, ... schema and then use DDL code to create the corresponding objects in SQL Server. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Dynamic MDB creation for specific formats 2000-2007
    ... If the specific format could be created from the outset - ... the resulting database - if they were - wouldn't care about any of this. ... ¤ If the database is being created on one system which by default creates ... It doesn't matter when accessing the database through Jet ADO or DAO. ...
    (microsoft.public.vb.database.ado)