Last post Feb 19, 2010 03:34 PM by htn123
Feb 18, 2010 01:24 PM|htn123|LINK
I am storing an image file into Access database using access form. I am trying to read it out and render it on a webpage using ASP.Net 3.5 and C# but it has read error message.
But if I store the same image to Access using ASP.NET and C# and then retrieve it using ASP.NET and C# and has no problem at all.
Is Access store varbinary difference that ASP.NET store varbinary?
Feb 18, 2010 01:29 PM|rtpHarry|LINK
What code are you using to extract it? Perhaps you are trying to display it in the wrong format. This would work if you put it in using that code but not if you tried to take it out when it was generated and inserted in a different format...
Feb 18, 2010 01:46 PM|htn123|LINK
In C# code behind, I use Byte Stream class to write and MemoryStream Class to read.
in the Access DB I used MS Access attachment functionality to store the image into the database.
Feb 18, 2010 02:17 PM|hans_v|LINK
in the Access DB I used MS Access attachment functionality to store the image into the database
I'm not sure what you mean with 'attachment functionality'? To store files in Access, you should use the Ole-Object datatype. More info, read this:
Feb 18, 2010 02:32 PM|htn123|LINK
We are using MS Access Form Design Tools to create an Access frontend to enter the data. When we use Form design, we chose "OLE Type allowed" as "Either" if that makes any sense.
As I have mentioned, if I used this Access Frontend to write the image to the Access DB, I can't read it using ASP.net.
When I use ASP.net to write the image and read using ASP.net, it worked perfect. So I am trying to figure out if the Access OLE from the form design write the image differentce from ASP.net write.
Feb 19, 2010 03:34 PM|htn123|LINK
Well, I posted on another sub forum and I got the answer if anyone care.
Access padded and extra 78 bytes to the image file, sometime more before it write to the database!!!.
So one of the solution is to write our own image reader and call that reader from Access. So the file will get written as is without any extra craps!!!.