简体   繁体   English

MS Access,SQL Server映像字段

[英]MS Access, SQL Server image field

I have spent nearly 2 days in trying to figure this out. 我花了将近2天的时间试图解决这个问题。 We have an Access Project (adp) from Year 2000 that stores images to SQL Server 2008. I have tried connecting directly to SQL Server and to open TIFF files but it didn't work. 我们有一个2000年的Access Project(adp),它将图像存储到SQL Server 2008.我尝试直接连接到SQL Server并打开TIFF文件,但它不起作用。 Also tried to copy/paste the image field content into a file, renaming as TIFF and trying to open it but it didn't work as well. 还尝试将图像字段内容复制/粘贴到文件中,重命名为TIFF并尝试打开它但它也不起作用。 The problem with the content in the image field is that it is not of the right size. 图像字段中内容的问题在于它的大小不正确。 It is only 15-20KB but the files at that point should be around 3MB. 它只有15-20KB,但那时的文件大约应该是3MB。 It works fine if I retrieve the same data back in to the ACCESS project application. 如果我将相同的数据检索回ACCESS项目应用程序,它可以正常工作。

I have tried TiffLib.net and few other things. 我尝试过TiffLib.net和其他一些东西。

So, has anyone got any idea on how to migrate those image fields into SQL? 那么,有没有人知道如何将这些图像字段迁移到SQL?

Thanks 谢谢

Well the Image data type stores a binary version of your image. 那么Image数据类型存储了图像的二进制版本。 Now the conversion process is explain in the below links. 现在转换过程在下面的链接中解释。 You'll need to use a library to convert a byte array into image object. 您需要使用库将字节数组转换为图像对象。

http://www.akadia.com/services/dotnet_load_blob.html http://www.akadia.com/services/dotnet_load_blob.html

http://www.dreamincode.net/forums/topic/103960-save-and-retrieve-images-with-sql-server/ http://www.dreamincode.net/forums/topic/103960-save-and-retrieve-images-with-sql-server/

Hopefully this helps. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM