Strip OLE header information (MS Access / SQL Server)

百般思念 提交于 2019-12-06 01:52:21

Using MS Access 2007 (I need to test other MS databases) the format seems to be:

84 bytes
file name + \0
full path + \0
5 bytes + [2] bytes (the third byte of those five bytes)
temp path + \0
4 bytes
actual data (if not using a link to the file)

So far I simply parse and strip the part before the actual data, but I'm still wondering if there's no way to use something like COleDataSource to help parse this information more robustly.

Also note that this format only applies for generic content (start tag 0x15 0x1c 0x32). When using bitmaps (start tag 0x15 0x1c 0x2f) there's a fixed offset of 78 bytes and when using PowerPoint (start tag 0x15 0x1c 0x34) there's a fixed offset of 95 bytes.

See Stephen Lebans OleToDisk code. Note that the code is in VBA. Also I don't know that this will work as is in SQL Server.

I'm reposting my comment as an answer:

Don't use OLE fields, just use regular BLOBs.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!