PDA

View Full Version : OLE Data Transfers!



prabhafriend
01-05-2010, 02:42 AM
I have an OLE Data (Bitmap) in an access table. How to place that OLE Data (picture) in an excel sheet?

stanl
01-05-2010, 03:59 AM
First, it would help to know if the bitmap is embedded as a binary OLE field or linked. Either way you would use the clipboard to transfer to Excel, but a BinaryOLE Field requires an extra step .

prabhafriend
01-05-2010, 06:03 AM
I am having an embedded object(binary). All data-types are not same?!!! If they are then why can't we take that OLE in a recordset and transfer it everywhere we need it?

stanl
01-05-2010, 07:00 AM
Embedded Images as OLEBinary Fields need to be handled with an ADO.Stream, or Excel's PasteSpecial - it is not just a simple field to field conversion.

prabhafriend
01-05-2010, 07:16 AM
Dear Friend!
First I want to thank you for your extensive replies even though many doesn't even want to look into my post. Anyway I believe you know the basics of handling the OLE Datatypes. I just want to know if there is any article or tutorilal which describes from the basics of the OLE Datatypes and all. Actually I want to understand it before using it than just to satisfy the immediate scenario. I believe you understand me. Kindly help. For your information this is the first time I ever have to deal with this kind of scenario.

stanl
01-05-2010, 08:26 AM
First,let me say I am still not sure if your image is linked or truly embedded as Binary OLE. If the latter, then you would have already used an ADO Stream to insert the data as a Binary Array. One way to prove this:

If you can open your Access Table and click/double-click on the image field and the image appears, then your image is linked - which means that Access merely holds a pointer to the .bmp file.

If this is the case, then then you need to explain more fully how you expect the .bmp to be displayed in Excel.

If you really want help from others on this forum, you should upload a sample .mdb with 1 row containing the data you want help with.

prabhafriend
01-05-2010, 08:39 AM
Stanl...
First I want to clear you that I Embeds not Links the Objects into the Field. As you said. It previews the Data in Table View. But I dont know how to display that data in Excel. I tried pictures.insert, but It did not work. My code anyway
Sub storepic()
Dim myapp As New Excel.Application
Dim dummyset As Recordset
Set dummyset = CurrentDb.OpenRecordset("Select * from Logos;")
Excel.Application.Visible = True
Excel.Workbooks.Add
Excel.ActiveCell = dummyset("Logo_Name")
Excel.ActiveSheet.Pictures.insert dummyset("Logo")
End Sub

Thanks in Advance. Thank you.

stanl
01-05-2010, 02:00 PM
Please review this

http://www.ammara.com/articles/accesspictureole.html#S2

Your image(s) appear linked (whether you say embedded or not the process is called linking and embedding, whereas true embedded means the data is stored in raw binary format).

My guess is that if you display the image in access, copy it to the clipboard, open excel then choose PasteSpecial it will transfer. Coding this process is another matter completely and as I generally store the data as binary in order to avoid bloat and for portability/xml transfer to other PC's I hope someone else reading this can post code for that process.

jingjing
06-06-2010, 06:52 PM
thank you for you warm hospitality accorded to me and my delegation during our
recent visit to your country.