0

I have a SQL Server database with a table that has a column that stores an image. I have another database and I would like to store the image from the SQL Server database into it. It's type is MS Access 2000 format .mdb.

The problem is I get back the content of the column and I put them in an array of bytes as follows:

 Dim arrByte() As Byte = CType(dtAll.Rows(0)("DailyProgram_Image"), Byte())

It sends me back the data of the image as byte type. When I try to save this into the access DB it give me an error because of type mismatch.

amrswalha
  • 372
  • 8
  • 20
  • Is your access table field set to the type of 'Ole Object'? – Matt Donnan Dec 17 '11 at 14:46
  • Please can you provide details of the access table, and also the code you're trying to use to save the byte array into the access Table. – Jon Egerton Dec 17 '11 at 14:55
  • There are some notes here that may be of interest: http://stackoverflow.com/questions/3398437/store-byte-in-access-2010/3398696#3398696 – Fionnuala Dec 17 '11 at 19:45
  • Do you know that it's when you save you get the error? The source line you've included in your answer appear to be the one where you fetch the image. –  Dec 17 '11 at 21:28
  • Okay now the type of the cloumn is OLE object. I try to insert it as a normal insert statemnt "INSERT INTO [Desc_Image] Values (@Desc_Image)" And i get back the image from the SQL and but it in the arrByte then I try to insert it on the Access File – amrswalha Dec 18 '11 at 08:59

1 Answers1

0

Codeproject has an article about uploading and downloading BLOBs to Access here http://www.codeproject.com/KB/database/AccessBlob.aspx