Question Linking jpg files with a Mysql backend

xcrx

Edge
Local time
Today, 09:19
Joined
Oct 21, 2009
Messages
80
I am working on a database that manages parts for a plant. It is set up with an access front end and a Mysql backend. I have a table called tblParts. This table contains all the information about each part inclueding an field for a blueprint. I originaly had the backend set up in access and then I ported it to mysql. When it was in access I had the blueprint field set as an attachment field so I could easly add prints and also display them on forms which is very important for this project.

After I ported the database if converted my attachment field to an OLE object field. I can still attach prints but it will no longer preview them. Is there a setting that I need to change to preview the files or do I need to make the field something other than an OLE object field?

Any help would be great.

Thanks
 
Good question.

Someone asked the same question over there. See if this helps a bit.

Basically the issue as I see it is that the way Access handles images, it assumes the images is local and it then wraps its own metadata around the image for display in an image control. The image control cannot accept a binary stream as a source for the images.

See if either downloading images locally on demand or using Stephen Lebans' ImageClass meets your needs.

I've unfortunately never had a need to fiddle with images/LONGBLOBs -> OLE Object (though it should be attachment but I don't think they updated the ODBC specifications to point to attachment or update the image control to handle binary stream from remote source.

If I have free time, I may one day fiddle with this. Anyway let me know how you get along.
 
I got it working. What I ended up doing was installing microsoft photo editor. It has the correct OLE server to render jpgs. It all works just fine now.

Thanks for the help
 
That's awesome news.

If you don't mind me asking, how did this work? Do you automate Photo Editor via Access VBA or ? Do you have to download the files to hard drive to render it there?
 
Photo Editor works right after installing it. The images are rendered in the access database. The display quality is so so but I needed the images mostly for print and they look fine then.
 
xcrx, OLE objects is not a perfect way of putting images in database. First of all it makes your database really big - because jpgs are saved as uncompressed bitmaps along with original file. Second problem is no other program except MS Access can "understand" OLE object packing, thus you can not get your pictures from your MySQL database without Access.

Take a look at AccessImagine, a small shareware component that saves images as plain JPGs and eliminates all image-related problems you can face. Beside that it features the easiest way of adding images to database - look at this video.
 
Here a bit of script:

Code:
Function GetPicture()
Dim FullPath As String
    With CodeContextObject
        FullPath = GetImageDir & .[ImageFile]
        If Dir([FullPath]) <> Empty Then
            .[ImageControl].Visible = True
            .[ImageControl].Picture = FullPath
        Else
            .[ImageControl].Visible = False
        End If
    End With
End Function

GetImageDir just strings out the Path
[ImageFile] containin this instance the PartID and file type

Simon
 

Users who are viewing this thread

Back
Top Bottom