转换MS Access“OLE对象”回到普通的JPEG - 最好的方法? [英] Converting MS Access "OLE Objects" back to plain JPEGs - best way?
问题描述
背景:我们有一个旧的(但业务关键型)SQL Server数据库,带有MS Access ADP前端;这最初是从一系列Access数据库升级到SQL Server。
Background: We have an old (but business-critical) SQL Server database with an MS Access ADP front-end; this was originally upsized to SQL Server from a series of Access databases.
该数据库可以跟踪客户的有害物质,并存储大量图像。这些图像从MS Access插入,并作为OLE对象放入数据库。
This database tracks hazardous materials for our customers, and stores a large number of images. These images are inserted from MS Access, and get put into the database as OLE Objects.
问题是:
- 除了Access / Office之外的其他任何内容都很难读出
- 存在大量的存储空间 - 大约10GB的图像占用600多GB的存储空间space(!)
我的问题是:你建议用什么方法将这些膨胀的对象转换回简单的JPEG?一旦我们这样做,我们最终可以将我们的前端从Access迁移到一个简单的基于Web的系统,我们的备份时间将再次变得易于管理!
My question is this: what way would you recommend to convert these bloated objects back into simple JPEGs? Once we do this we can finally migrate our front-end from Access and onto a simple web-based system, and our backup times will become manageable again!
推荐答案
从这里获取* .bas文件 http:http://stackoverflow.com/Content/img/wmd/ul.png//www.access-im-unternehmen.de/index1.php?BeitragID = 337& id = 300 (不幸的是它是德语)。
Take the *.bas file from here http:http://stackoverflow.com/Content/img/wmd/ul.png//www.access-im-unternehmen.de/index1.php?BeitragID=337&id=300 (unfortunately it is German).
它使用MS的GDI + lib(包含在Win标准安装中)来导入/导出Access OLE图像。
It uses the GDI+ lib from MS (included in Win standard installation) to import/export pics to/from Access OLE.
界面的粗略翻译:
- IsGDIPInstalled:检查GDI +的安装
- InitGDIP:初始化GDI +。
- ShutDownGDIP:放弃GDI +(导入并使用!)
- LoadPictureGDIP:加载pic在StdPicture对象中(bmp,gif,jp(e)g,tif,png,wmf,emf和ico)。
- ResampleGDIP:Scale如果需要,可以使用新的尺寸和锐化。
- MakeThumbGDIP:制作缩略图并用颜色填充边框。
- GetDimensionsGDIP:获取TSize-Struktur中的尺寸以像素为单位。
- SavePicGDIPlus:将图片objekt保存为BMP,GIF,PNG或JPG(具有给定质量的jpg)
- ArrayFromPicture:返回a用于将pic放入表的OLE字段的picutre的字节数组
- ArrayToPicture:创建包含图片的表的OLE字段的字节数组
- IsGDIPInstalled: Checks for installation of GDI+
- InitGDIP: Init of GDI+.
- ShutDownGDIP: Deinit of GDI+ (importand to be used!)
- LoadPictureGDIP: Loads pic in StdPicture object (bmp, gif, jp(e)g, tif, png, wmf, emf and ico).
- ResampleGDIP: Scales pic to new dimensions and sharpens if needed.
- MakeThumbGDIP: Makes thumbnail and fills border with color.
- GetDimensionsGDIP: Get dimensions in TSize-Struktur in pixel.
- SavePicGDIPlus: Saves Picture objekt in file as BMP, GIF, PNG or JPG (jpg with given quality)
- ArrayFromPicture: Returns a byte array of picutre to put pic into OLE field of table
- ArrayToPicture: Creates byte array of OLE field of table containing a picture
这篇关于转换MS Access“OLE对象”回到普通的JPEG - 最好的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!