如何在SQL Server(MS Access界面)中存储图片

时间:2021-01-16 23:59:30

Following podcast #59, I've been considering moving some images from an MS Access DB into MS SQL Server (it's the only piece I haven't migrate over yet). Right now they are stored as OLE Objects in the MS Access DB.

在播客#59之后,我一直在考虑将一些图像从MS Access DB移动到MS SQL Server(这是我尚未迁移的唯一部分)。现在,它们作为OLE对象存储在MS Access DB中。

However, I haven't got a clue what data type they should be stored as on the SQL Server side, or how to get them inserted through the interface (MS Access via ODBC).

但是,我还没有弄清楚它们应该存储在SQL Server端的数据类型,或者如何通过接口插入它们(通过ODBC进行MS Access)。

4 个解决方案

#1


I would use the image type, and I would NOT use Access to transfer them. I'd use the Sql Server Import and Export Wizard to do it. To do so, right-click the database you want to import to in Sql Server Management Studio, select Tasks, and then select Import Data.

我会使用图像类型,我不会使用Access来传输它们。我将使用Sql Server导入和导出向导来执行此操作。为此,请在Sql Server Management Studio中右键单击要导入的数据库,选择“任务”,然后选择“导入数据”。

#2


There is several BLOB-type fields in MS SQL Server for storing binary data - but some of them have size limitations.

MS SQL Server中有几个用于存储二进制数据的BLOB类型字段 - 但其中一些具有大小限制。

If you use SQL 2005 or higher, the best choice is varbinary(MAX). It can store really big data pieces.

如果使用SQL 2005或更高版本,最好的选择是varbinary(MAX)。它可以存储非常大的数据。

Be warned, that keeping pictures in OLE format will cause a lot of problems for you in future. While you're moving on, consider converting your images to usual graphic files (like JPG). It will save resourses of SQL Server and improve Access displaying speed.

请注意,保存OLE格式的图片将在未来给您带来很多问题。在您继续前进时,请考虑将图像转换为常用的图形文件(如JPG)。它将节省SQL Server的资源并提高Access显示速度。

I recommend to take a look at AccessImagine (http://access.bukrek.net), it would help you to avoid a lot of headaches about the images. Just look at video.

我建议你看一下AccessImagine(http://access.bukrek.net),它可以帮助你避免很多关于图像的麻烦。只看视频。

#3


We have used DBPix from Ammara, www.Ammara.com for 5 or 6 years now to handle the capture and display. Very easy to use ActiveX control with complete sample code in their documentation, and affordable.

我们使用Ammara的DBPix,www.Ammara.com 5年或6年来处理捕获和显示。非常容易使用ActiveX控件,其文档中包含完整的示例代码,价格合理。

Our team preferentially stores images on disk and refers to them by storing their location in a varchar, but the control will handle both methods.

我们的团队优先将图像存储在磁盘上,并通过将它们的位置存储在varchar中来引用它们,但控件将处理这两种方法。

#4


You can try to compare em, it can be interesting as AccessImagine is newer one.

您可以尝试比较它,它可能很有趣,因为AccessImagine是较新的。

#1


I would use the image type, and I would NOT use Access to transfer them. I'd use the Sql Server Import and Export Wizard to do it. To do so, right-click the database you want to import to in Sql Server Management Studio, select Tasks, and then select Import Data.

我会使用图像类型,我不会使用Access来传输它们。我将使用Sql Server导入和导出向导来执行此操作。为此,请在Sql Server Management Studio中右键单击要导入的数据库,选择“任务”,然后选择“导入数据”。

#2


There is several BLOB-type fields in MS SQL Server for storing binary data - but some of them have size limitations.

MS SQL Server中有几个用于存储二进制数据的BLOB类型字段 - 但其中一些具有大小限制。

If you use SQL 2005 or higher, the best choice is varbinary(MAX). It can store really big data pieces.

如果使用SQL 2005或更高版本,最好的选择是varbinary(MAX)。它可以存储非常大的数据。

Be warned, that keeping pictures in OLE format will cause a lot of problems for you in future. While you're moving on, consider converting your images to usual graphic files (like JPG). It will save resourses of SQL Server and improve Access displaying speed.

请注意,保存OLE格式的图片将在未来给您带来很多问题。在您继续前进时,请考虑将图像转换为常用的图形文件(如JPG)。它将节省SQL Server的资源并提高Access显示速度。

I recommend to take a look at AccessImagine (http://access.bukrek.net), it would help you to avoid a lot of headaches about the images. Just look at video.

我建议你看一下AccessImagine(http://access.bukrek.net),它可以帮助你避免很多关于图像的麻烦。只看视频。

#3


We have used DBPix from Ammara, www.Ammara.com for 5 or 6 years now to handle the capture and display. Very easy to use ActiveX control with complete sample code in their documentation, and affordable.

我们使用Ammara的DBPix,www.Ammara.com 5年或6年来处理捕获和显示。非常容易使用ActiveX控件,其文档中包含完整的示例代码,价格合理。

Our team preferentially stores images on disk and refers to them by storing their location in a varchar, but the control will handle both methods.

我们的团队优先将图像存储在磁盘上,并通过将它们的位置存储在varchar中来引用它们,但控件将处理这两种方法。

#4


You can try to compare em, it can be interesting as AccessImagine is newer one.

您可以尝试比较它,它可能很有趣,因为AccessImagine是较新的。