Jump to content

Recommended Posts

Hi there!

 

I've got a problem transferring data from an Access database to a mysql one. I'm not responsible for any of these 2 databases, else I would have stored the paths to the pictures rather than the pictures themselves in the db but anyway.

I succeeded to transfer all the information except the images. I mean, I can transfer the data but of course, once in mysql, the picture cannot be read correctly. I guess that what I have to do, first, is to read this ole picture from Access and to convert it to jpeg, and then insert it in my mysql db. But I can't find a way to get this ole picture from access and to convert it correctly.

 

Does anyone have any idea?

Thanks in advance.

This probably isn't going to be very helpful but..

I would create a little ASP code to convert the OLE back into Jpegs and using the RecordID as the name.. then upload via FTP and then create a little oneoff PHP script link them in

 

heres some ASP code that will display the image, just add a write to binary section

<%
Dim adoCon
Dim rs
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database/images.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT ID,IMAGE FROM table WHERE ID = 1"
rs.Open strSQL, adoCon

Response.Clear
Response.ContentType = "image/jpg"
Response.BinaryWrite rs("IMAGE")

rs.Close
adoCon.Close
Set rs = NothingadoCon.Close
Set adoConn = Nothing
%>

Thanks for the answer!

Actually I'd like to keep php, I guess it should not be so different.

For the moment, I read the data, but it's encapsuled with the ole format, that's why I can't read them anyway. I just have to find the way to convert them to jpg, and then I can handle the rest.

 

Thanks!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.