locked
Insert file into ole object field in access database with asp.net RRS feed

  • Question

  • User-271063510 posted

    Good afternoon,

    I'm trying to save a file in an OLE object field access with asp.net. The file is saved correctly as long binary databut I have no a way to view these long binary data (file) directly in Acess table view (by clicking directly on the OLE object field, this is a customer requirement) . I read that Access adds a "ole data headers" when you add a file to an OLE Object field directly from ACCESS, but not if there is any way to generate these "ole data headers" from ASP.NET, so that Access imported directly open files from ASP.NET. In vb6 ole control exists and the method CreatedEmbed to make something of this, but I do not know how I can do something similar in asp.net

    Any help is appreciated,

    Thank you!

     

    Tuesday, December 6, 2011 5:57 PM

All replies

  • User3866881 posted

    Hello:)

    Ole object——in the asp.net——You can convert into byte collection and set Response.Context to assign its type,and then in the end you can try to use Response.BinaryWrite to output the real thing for users to download。

    This is a sample for you to save objects ( an image ) into Access datatable and retrieve from it。

    http://www.mikesdotnetting.com/Article/123/Storing-Files-and-Images-in-Access-with-ASP.NET

    Wednesday, December 7, 2011 10:11 PM
  • User-1199946673 posted

    Decker. Read the question again? This is NOT an answer to the question being asked!

    Thursday, December 8, 2011 3:02 AM
  • User3866881 posted

    Decker. Read the question again? This is NOT an answer to the question being asked!

    Hello:)

    Welcome your feedback hans_v,and in my mind,I think the questioner wants to retieve the binary stream and view it。I consider any file can be converted into binary formation and download it as a file and use specific software to open it。That's what I'm thinking of。

    Of course,if you think my idea isn't good,or something misunderstand it……You can follow up your nice ideas。

    Best reguards!

    Thursday, December 8, 2011 3:21 AM
  • User-1199946673 posted

    I think the questioner wants to retieve the binary stream and view it

    Correct. But where does he want to view it?

    to view these long binary data (file) directly in Acess table view (by clicking directly on the OLE object field, this is a customer requirement)

    In Mikes article, he firts describes the Access Ole Object Dattype. Then he explains that this datatype can also be used in .NET to store Long Binary Data (BLOB), and he's showing an example of how to do that. But the question here's is how to store an image through .NET in the format that Access uses (not as Long Binary Data!), so the image can be used in Access?

    Thursday, December 8, 2011 4:14 AM
  • User-271063510 posted

    Good afternoon,
    First of all thank you very much for your answers ;-). HANS_V comment that is right, is exactly what I need to save the image (or other file) from ASP.NET in the format used by access, and to open the image (or other files) directly from access in table view (by clicking directly on the OLE object field).

    Thursday, December 8, 2011 11:11 AM
  • User-2064262021 posted

    Hi,

    1. Exactly which file formats would the images and other files be?
    2. Do you care if this is Access 2003 and earlier (mdb and Jet) or Access 2007-2010 (accdb and ACE)?
    3. What is the reasoning behind this specific design goal?

    Thanks!

    Cathy Miller

    Microsoft Online Community Support

    Friday, January 6, 2012 9:38 AM
  • User-271063510 posted

    Good morning,

    Sorry about delay.

    1. Whatever,...jpg, gif, pdf, word,..

    2. Access 2003 and earlier (mdb and jet)

    3. It is a client requirement. We have to implement it in a new .net web aplication. The goal is to export the sql data storage through the aplication or by other way (sql export for example) into the MS Access. The functionality / use / infraestructure about the ms access is not our business,.. they want to use it for internal purposes

    Thanks for your reply!

    Friday, January 20, 2012 2:49 AM
  • User1231667415 posted

    Interesting, even I would like to know how this can be done.

    http://www.wong-sir.com/cit/workshops/access/access_workshop_06.pdf

    Friday, January 20, 2012 5:48 AM
  • User-2064262021 posted

    Hi,

    This type of question requires a more in-depth level of support. 

    Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Thanks,

    Cathy Miller

    Wednesday, January 25, 2012 12:25 PM