vba 如何将 Microsoft Access 中的嵌入图像保存到文件中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7770134/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 14:16:46  来源:igfitidea点击:

How do I save an embedded image in Microsoft Access to a file?

imagems-accessvba

提问by johnny

I have a lot of images embedded in an Access database. I need to save the images to a file. How do I do this in VBA?

我在 Access 数据库中嵌入了很多图像。我需要将图像保存到文件中。我如何在 VBA 中做到这一点?

采纳答案by Christian Specht

You need the GetChunkand AppendChunkfunctions.

您需要GetChunkAppendChunk功能。

Here are some MSDN pages about how to load and save images from Access databases:

以下是一些关于如何从 Access 数据库加载和保存图像的 MSDN 页面:

And here are two example databases for Access 97 and 2000.
(You want the module basBLOBfrom in there - the code is based on the second MSDN page)

这是Access 97 和 2000 的两个示例数据库
(你想要模块basBLOB在那里 - 代码基于第二个 MSDN 页面)

回答by MaxD

OLE objects is bad way of storing images in MS Access. Use OLEToDisk (http://www.lebans.com/oletodisk.htm) to save your images as pic files.

OLE 对象是在 MS Access 中存储图像的糟糕方式。使用 OLEToDisk (http://www.lebans.com/oletodisk.htm) 将您的图像保存为 pic 文件。

After that reimport them in nice way. Check AccessImagine (http://access.bukrek.net) for working with images in Access - it does all the hard job.

之后,以很好的方式重新导入它们。检查 AccessImagine (http://access.bukrek.net) 以在 Access 中处理图像 - 它完成了所有艰苦的工作。