{"id":89,"date":"2017-04-05T08:27:25","date_gmt":"2017-04-05T08:27:25","guid":{"rendered":"http:\/\/www.yohz.com\/blogs\/?p=89"},"modified":"2022-07-07T10:31:12","modified_gmt":"2022-07-07T02:31:12","slug":"extracting-files-and-data-from-ole-object-fields","status":"publish","type":"post","link":"https:\/\/www.yohz.com\/blogs\/2017\/04\/05\/extracting-files-and-data-from-ole-object-fields\/","title":{"rendered":"Extracting files and data from OLE Object fields"},"content":{"rendered":"<p>OLE Object fields are commonly used by applications using Access as the back-end database to store files and common document formats. \u00a0It is convenient because Windows handles how the files or documents are opened, modified, and saved via OLE servers. \u00a0However, it is difficult to extract the data from those fields because of the additional OLE information embedded together with your data.<\/p>\n<p>For example, let&#8217;s create a table in Access, and store a simple Excel workbook, first as an embedded object, and second as an embedded file.\u00a0 Our table structure is as follows:<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-94\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_01.png\" alt=\"\" width=\"464\" height=\"241\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_01.png 464w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_01-300x156.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_01-150x78.png 150w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/p>\n<p>We create the first record by directly embedding an Excel workbook.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-93\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_02.png\" alt=\"\" width=\"466\" height=\"261\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_02.png 466w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_02-300x168.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_02-150x84.png 150w\" sizes=\"(max-width: 466px) 100vw, 466px\" \/><\/p>\n<p>For the second record, we simply attach an existing Excel workbook.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-92\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_03.png\" alt=\"\" width=\"466\" height=\"261\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_03.png 466w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_03-300x168.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_03-150x84.png 150w\" sizes=\"(max-width: 466px) 100vw, 466px\" \/><\/p>\n<p>In Access, we can open both workbooks easily simply by double-clicking on them. \u00a0This is the OLE servers at work.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-91\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_04.png\" alt=\"\" width=\"639\" height=\"106\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_04.png 639w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_04-300x50.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_04-150x25.png 150w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/p>\n<p>Now if we take a look at the size of the 2 records using <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a>, we can see that the size of the embedded workbook is larger than the attached file. \u00a0The size of the attached file record is also larger than the original file size, because Access needs to add additional data to the file.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-90\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_05.png\" alt=\"\" width=\"624\" height=\"229\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_05.png 624w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_05-300x110.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/access_example_05-150x55.png 150w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>If you try to export the data as is, you will not be able to open the exported files, because the format itself is not Excel-compliant. \u00a0Both records in the OLE Object fields have had additional OLE wrappers added to them.<\/p>\n<p>The usual way to extract the content is to open each item individually in Excel, and save them to files. \u00a0This is a tedious process if you have a lot of records you need to extract.<\/p>\n<p>We have 2 products, <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> and <a href=\"http:\/\/www.yohz.com\/aole_details.htm\">Access OLE Export<\/a>, that can remove the OLE wrappers for data stored in OLE Object fields, and export them to disk.<\/p>\n<p><a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> is for technical users who are comfortable writing SQL queries to retrieve the required data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-588\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sivscreenshot.png\" alt=\"\" width=\"910\" height=\"593\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sivscreenshot.png 910w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sivscreenshot-300x195.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sivscreenshot-768x500.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sivscreenshot-624x407.png 624w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/p>\n<p><a href=\"http:\/\/www.yohz.com\/aole_details.htm\">Access OLE Export<\/a> is for less technically inclined users who just want to be able to select a table and export their data quickly.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-589\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/aolescreenshot.png\" alt=\"\" width=\"794\" height=\"701\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/aolescreenshot.png 794w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/aolescreenshot-300x265.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/aolescreenshot-768x678.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/aolescreenshot-624x551.png 624w\" sizes=\"(max-width: 794px) 100vw, 794px\" \/><\/p>\n<p>Both products can identify embedded Office document content, images, PDF content, Open Document content, and other common binary types. \u00a0Both products can also extract data from OLE Object fields used in other database engines like SQL Server, MySQL, Oracle, PostgreSQL, Firebird, SQLite, and ODBC data sources.<\/p>\n<p>There may be situations where both products are unable to identify embedded content correctly. \u00a0This may be because the registered OLE Server for that content type is not yet supported. \u00a0For e.g. PDF files can have different OLE servers like Adobe Acrobat, Foxit PDF Reader. Nitro, etc. \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>Download a <strong>FREE<\/strong> 14-day trial of <a href=\"http:\/\/www.yohz.com\/downloads\/sqlblobviewer\/SQLImageViewerSetup.zip\">SQL Image Viewer<\/a> or <a href=\"http:\/\/www.yohz.com\/downloads\/accessoleexport\/AccessOLEExportSetup.zip\">Access OLE Export<\/a> now, and see how easy it is to export your &#8216;trapped&#8217; OLE Object data.<\/p>\n<p>If instead you need to insert or update OLE-Object data in your databases, have a look at <a href=\"https:\/\/www.yohz.com\/aoi_details.htm\">Access OLE Import<\/a>.\u00a0 Using Excel spreadsheets as the input data, you can easily add and update your embedded or linked OLE-Object data.<\/p>\n<p>You can purchase our products on this <a href=\"https:\/\/www.yohz.com\/store.htm\">page<\/a>.<\/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\/05\/extracting-files-and-data-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\/05\/extracting-files-and-data-from-ole-object-fields\/\" data-type=\"button\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>OLE Object fields are commonly used by applications using Access as the back-end database to store files and common document formats. \u00a0It is convenient because Windows handles how the files or documents are opened, modified, and saved via OLE servers. \u00a0However, it is difficult to extract the data from those fields because of the additional [&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,11],"tags":[21,18,20,12],"_links":{"self":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/89"}],"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=89"}],"version-history":[{"count":12,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":1751,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/89\/revisions\/1751"}],"wp:attachment":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}