MS Access,SQL Server映像字段

时间:2022-09-16 06:44:37

I have spent nearly 2 days in trying to figure this out. 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. 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. 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. It works fine if I retrieve the same data back in to the ACCESS project application.

我花了将近2天的时间试图解决这个问题。我们有一个2000年的Access项目(adp),用于将图像存储到SQL Server 2008.我尝试直接连接到SQL Server并打开TIFF文件,但它不起作用。还试图将图像字段内容复制/粘贴到文件中,重命名为TIFF并尝试打开它但它也不起作用。图像字段中内容的问题在于它的大小不正确。它只有15-20KB,但那时的文件大约应该是3MB。如果我将相同的数据检索回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

谢谢

1 个解决方案

#1


1  

Well the Image data type stores a binary version of your 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.

那么Image数据类型存储了图像的二进制版本。现在转换过程在下面的链接中解释。您需要使用库将字节数组转换为图像对象。

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.

希望这会有所帮助。

#1


1  

Well the Image data type stores a binary version of your 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.

那么Image数据类型存储了图像的二进制版本。现在转换过程在下面的链接中解释。您需要使用库将字节数组转换为图像对象。

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.

希望这会有所帮助。