{"id":113,"date":"2017-04-23T07:44:33","date_gmt":"2017-04-23T07:44:33","guid":{"rendered":"http:\/\/www.yohz.com\/blogs\/?p=113"},"modified":"2022-07-07T10:32:45","modified_gmt":"2022-07-07T02:32:45","slug":"exporting-images-from-ole-object-fields","status":"publish","type":"post","link":"https:\/\/www.yohz.com\/blogs\/2017\/04\/23\/exporting-images-from-ole-object-fields\/","title":{"rendered":"Exporting images from OLE Object fields"},"content":{"rendered":"<p><em>\u2192 This article refers to SQL Blob Viewer, which has now been renamed to <a href=\"http:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a>.\u00a0 The techniques described in this blog is still applicable, as the functionality of the product remains the same.\u00a0 Only the name has changed.<\/em><\/p>\n<p>If you use OLE Object fields in your Access or SQL Server databases to store images, you know it&#8217;s convenient to just be able to click on the item and have Windows open the image using the registered viewer on your computer. \u00a0However, it becomes difficult to extract the images because Access adds additional OLE data to the stored images, thus changing their original form.<\/p>\n<p>Take a Windows bitmap image,<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-131\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_01.png\" alt=\"\" width=\"900\" height=\"708\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_01.png 900w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_01-300x236.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_01-768x604.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_01-150x118.png 150w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>and store it in an OLE Object field in a SQL Server linked-table.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-130\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_02.png\" alt=\"\" width=\"731\" height=\"423\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_02.png 731w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_02-300x174.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_02-150x87.png 150w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><\/p>\n<p>The original file was 2,002,182 bytes in size, but has increased to 2,002,298 bytes when stored in the OLE Object field. \u00a0Access has added 116 bytes to the image.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-129\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_03.png\" alt=\"\" width=\"676\" height=\"285\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_03.png 676w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_03-300x126.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_03-150x63.png 150w\" sizes=\"(max-width: 676px) 100vw, 676px\" \/><\/p>\n<p>and that the data stored in the field is different from the original bitmap file.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-128\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_04.png\" alt=\"\" width=\"771\" height=\"651\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_04.png 771w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_04-300x253.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_04-768x648.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_04-150x127.png 150w\" sizes=\"(max-width: 771px) 100vw, 771px\" \/><\/p>\n<p>How can we then export this image? \u00a0One way is to open the table using Access, then double click on the data, and Access should then open the stored image in the registered OLE server for that image type, in our example Microsoft Paint.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-127\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_05.png\" alt=\"\" width=\"697\" height=\"564\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_05.png 697w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_05-300x243.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_05-150x121.png 150w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><\/p>\n<p>However, this is a tedious process if we need to export a lot of images. \u00a0<a href=\"http:\/\/www.yohz.com\/sbv_details.htm\">SQL Blob Viewer<\/a> and <a href=\"http:\/\/www.yohz.com\/aole_details.htm\">Access OLE Export<\/a> are two applications that we developed to easily export images and other data stored in OLE Object fields. \u00a0Exporting the items using <a href=\"http:\/\/www.yohz.com\/sbv_details.htm\">SQL Blob Viewer<\/a> or <a href=\"http:\/\/www.yohz.com\/aole_details.htm\">Access OLE Export<\/a> is just a matter of writing the appropriate SQL query or selecting the right table. \u00a0<a href=\"http:\/\/www.yohz.com\/sbv_details.htm\">SQL Blob Viewer<\/a> is for users who are comfortable writing queries and want more control over how images are exported, while <a href=\"http:\/\/www.yohz.com\/aole_details.htm\">Access OLE Export<\/a> is for users who just want to be able to select a table or write a simple query and export the images as is.<\/p>\n<p><a href=\"http:\/\/www.yohz.com\/sbv_details.htm\">SQL Blob Viewer<\/a> also displays a preview of the image when we query the table:<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-126\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_06.png\" alt=\"\" width=\"800\" height=\"600\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_06.png 800w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_06-300x225.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_06-768x576.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/ole_06-150x113.png 150w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>So if you have a ton of images that you need to export from OLE Object fields, give <a href=\"http:\/\/www.yohz.com\/sbv_details.htm\">SQL Blob Viewer<\/a> or <a href=\"http:\/\/www.yohz.com\/aole_details.htm\">Access OLE Export<\/a> a try.<\/p>\n<p>There may be situations where both products are unable to identify embedded images\u00a0correctly. \u00a0This may be because the registered OLE Server for that content type is not yet supported. \u00a0In these cases, send us (at <a href=\"mailto:support@yohz.com\">support@yohz.com<\/a>) a sample of the embedded data, and we will add support for that OLE server type.<\/p>\n<p>See also:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.yohz.com\/blogs\/2020\/05\/08\/naming-the-exported-files-in-access-ole-export-and-sql-blob-export\/\">custom naming convention for your exported files<\/a><\/li>\n<\/ul>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/www.yohz.com\/blogs\/2017\/04\/23\/exporting-images-from-ole-object-fields\/\" action=\"like\" colorscheme=\"light\" layout=\"button\"  size=\"small\"><\/fb:like><\/div><div class=\"fb-share-button  \" data-href=\"https:\/\/www.yohz.com\/blogs\/2017\/04\/23\/exporting-images-from-ole-object-fields\/\" data-type=\"button\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>\u2192 This article refers to SQL Blob Viewer, which has now been renamed to SQL Image Viewer.\u00a0 The techniques described in this blog is still applicable, as the functionality of the product remains the same.\u00a0 Only the name has changed. If you use OLE Object fields in your Access or SQL Server databases to store [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[17,5,11],"tags":[18,20,7],"_links":{"self":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/113"}],"collection":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/comments?post=113"}],"version-history":[{"count":3,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"predecessor-version":[{"id":1752,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/113\/revisions\/1752"}],"wp:attachment":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}