Opening attachment stored in MS Access using C#

I have a column in my table stored in MS Access as a Attachment data type. It stores various files such as docx, pdf's etc. I am trying to display a file from the table using a documentViewer (obtained from XtremeDocumentStudio .NET). I also have a combo box
on my form with a list of employee ID's. When a particular ID is selected from the combo box I want the associated attachment with that employee to be displayed in the documentViewer. So the SQL may look like the following:
SELECT EmployeeAttachment FROM Employee WHERE EmployeeID = 2;
I have been stuck on this problem for a while and am not sure on how to implement it. Any help or ideas on how I would display the attachment in the documentViewer would be greatly appreciated. Thank you.

Hello,
For getting the attachment filed part of your question, you could have a try with the Microsoft.Office.Interop.Access.Dao:
http://stackoverflow.com/a/11819599
To save the read attachment to a temp document file and use that file as the data source.
For how to binding the documentviewer control with the data source, since this is a 3<sup>rd</sup> control, it is beyond the scope of our support, I suggest that you could ask it on the XtremeDocumentStudio .NET forum:
http://www.gnostice.com/support.asp
Or, if your app is a WPF project, you could also consider using the Microsoft DocumentViewer control and here is an example for its usage:
How to view word document in WPF application (CSVSTOViewWordInWPF)
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • I get email with adobe ? Do not open attachment  what app can I use

    Adobe  I get EMail. Can not open attachment (pictures etc) what apps can I use

    Adobe is a company, not a file format. What format are the attachments? PDF? Flash? The former should open without any problem. The latter will not work on your iPad as there is no Flash plug in for iOS.
    The more details you can give about your issue, the better the answers you'll get.
    Best of luck.

  • Opening a file for write access [trailing spaces required]

    Hi,
    i am opening a file for write access using:
    OPEN DATASET W_FILENAME FOR OUTPUT IN TEXT MODE.
    However, when i perform transfer W_LINE to W_FILENAME, trailing spaces in W_LINE are trimmed off automatically. I have tried various methods without success.
    Appreciate if help can be offered. Thank You~

    haiiiiiii,
    OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE encoding default.
    TRANSFER OUTREC TO OUTFILE.
    CLOSE DATASET OUTFILE.
    here out rec we are moving to the out put  file.
    for ur requrement concatinate all the fioelds to outrec and then move it to file.
    then u wont get any problems with spaces

  • How do I access an external hard drive attached to an Airport Extreme using the Finder's "Go to the folder" feature?

    How do I access an external hard drive attached to an Airport Extreme using the Finder's "Go to the folder" feature?
    I have an external hard drive attached to my Airport Extreme and I can access it just fine through Finder.  I would like to be able to keyboard navigate to it in an efficient manner.  I tried to use the "Go to the folder" feature but was unable to.
    I had tried dragging the drive to the Network folder but the shortcut it created does not lead to the drive's contents...it seems to lead right back to the parent directory:
    I hope I explained the question well.  Thank you for all of your help and time in tending to my inquiry.

    Cant you set up "back to my mac" then go to finder preferences and put a check mark under everything under the shared location. Also set up back to my mac on your airport extreme.

  • Problem storing date in MS Access using JSP

    Hi all,
    Can anyone please help me storing date in MS Access using Java i am getting errors. I think it is probably because MS Access take "date/month". I am entering a string with date and month example
    1st October as "0110". I don't know how to enter a date in MS Access.
    Here is my code.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <HTML>
    <HEAD>
    <TITLE>  </TITLE>
    </HEAD>
    <BODY>
    <%
       String emplno = request.getParameter("emplno");
       String date = request.getParameter("date");
       String proposal = request.getParameter("proposals");
       String network1 = request.getParameter("network");
       String suppassociates = request.getParameter("suppasso");
       String intmngt = request.getParameter("intmgt");
       String client[] = request.getParameterValues("client");
       String client1= request.getParameter("client1");
       String clientunit[] = request.getParameterValues("clientunit");
       String clientunit1=request.getParameter("clientunit1");
       int staffid = Integer.parseInt(emplno);
       double proposalunit=Double.parseDouble(proposal);
       double suppliersunit=Double.parseDouble(suppassociates);
       double networkunit=Double.parseDouble(network1);
       double internalmgtunit=Double.parseDouble(intmngt);
       Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
       Connection con = DriverManager.getConnection("jdbc:odbc:finalmp" );
       String activities= "INSERT INTO StaffActivities (StaffID,Date,ProposalUnit,NetworkingUnit,SuppliersAssociatesUnit,InternalMGTUnit) VALUES (?,?,?,?,?,?)";
       PreparedStatement pstmt = con.prepareStatement(activities);
       pstmt.setInt(1,staffid);
       pstmt.setString(2,date);
       pstmt.setDouble(3,proposalunit);
       pstmt.setDouble(4,suppliersunit);
       pstmt.setDouble(5,networkunit);
       pstmt.setDouble(6,internammgtunit);
       pstmt.executeUpdate();
       //String emplno="hello";
       //String entered_date="hello";
       //int access_date=0;
       //int user_date=0;
       if(pstmt!=null)
         pstmt.close();
       if(con!=null)
         con.close();
    %>  
    </BODY>
    </HTML>

    i hope this can help you
    public static String convertToISOFormat(Date dateTime) {
            // ISO Format: 'YYYY-MM-DD HH:MM:SS'
            String returnValue = fillLeft(String.valueOf(dateTime.getYear()+1900), 4,
                    '0')
                    + "-"
                    + fillLeft(String.valueOf(dateTime.getMonth()+1), 2, '0')
                    + "-"
                    + fillLeft(String.valueOf(dateTime.getDate()), 2, '0')
                    + " "
                    + fillLeft(String.valueOf(dateTime.getHours()), 2, '0')
                    + ":"
                    + fillLeft(String.valueOf(dateTime.getMinutes()), 2, '0')
                    + ":" + fillLeft(String.valueOf(dateTime.getSeconds()), 2, '0');
            return returnValue;
        }

  • I cant open files stored in iCloud in iWork

    I am using the latest version of iWork on my iMac and I can't open any files that are stored in iCloud any time I try to open a document stored in iCloud in an iWork app I get a dialog box that says 'The file "xxx.pages" couldn't be opened.' It does not mater which iWork application I am trying to use I get a version of that dialog. I can still access these files using the iCloud apps on the web or the iOS apps on my iPhone or iPad.
    I was able to access these files at the beginning of January 2014 but sometime this month they stopped opening on the iMac and the latest updates to iWork did not help. I have reported this in feed back to Apple.
    Any ideas?

    As a work-around:
    In the "Pages -> Open ..." dialog, drag the document out of the iCloud, and onto your desktop.
    Once I did that, I could open and edit documents that I could not open when stored in the iCloud.  After the edits were complete, I could drag the document back to the iCloud and could open/edit it from my iPhone, but again not from the iMac until it was dragged back to the desktop.
    This only applies some of my documents.  Some simple "test" documents, open fine when they are stored on the iCloud.  My more complex documents, containing mathematical symbols and other advanced formatting, need to be dragged to the desktop.
    Hope that helps.

  • VMM Shared ISO error "User account does not have permission required to open attachment"

    I had this error once because the local service account was selected during installation of VMM.  I have reinstalled VMM with a Domain service account and the error went away.  However, the error is back. 
    "User account does not have permission required to open attachment '\\[servername]\VMMLibrary\server.ISO'. Error: 'General access denied error' (0x80070005). (Virtual machine ID GUID)"
    I tried to create this VM on Host1 and got the error. 
    I then went to Host2 and was able to create the VM while using the same ISO on the same VMM library that failed on the Host1. 
    Both hosts have agent 3.2.7634.0 and are both running Hyper-V Server 2012 R2.
    What is wrong with Host1 and how do I correct it?
    Thank you.

    This is a share configuration permissions issue.
    http://technet.microsoft.com/en-us/library/ee340124.aspx
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • Cant open attachment

    I cant open attachment on my outlook web access using the safari,  can anyone help?  I tried reinstalling the safari applications and also the MAC Snow Leopard but was not successful.  The error message is "Safari can't open this page.  Server is not responding please try again.  I try and try but to no avail.

    Hi,
    Might depend on the attachment, ie., .doc .jpg
    And check Safari / Preferences - Extensions. If you have any installed, turn that off then try to open an attachment.
    Carolyn 

  • OWA - Disable PRINT when opening attachment as Web Page

    Hi,
    To prevent data leakage in our organization I disabled Direct File Access so our users cant download attachments.
    I would like to ask on how to Disable PRINT icon when opening attachment as Web Page in OWA without using RMS.
    Regards, Jerome Pacificar

    Jerome,,, did you find a solution for this , if yes please mail me [email protected]
    Sathya Paul

  • Open Attachment option in Mail opens incorrect invite in Calendar

    My issue: if I double click or use the Open Attachment option in Mail for calendar invites, an invite from 2 years ago opens in Calendar for me to accept. If I use the Add to Calendar function, no problem & reads like it should do.
    I upgraded to ML about 2-3 weeks ago and Mail was spectacularly painful with the merge from SL not working at all. Calendar seemed to be ok, however this usse has started to appear in the last 24 hours.
    Ivites can be accepted no dram using the iPad or my wifes iPhone just seesm to beon the Mac that its a problem.
    Any thoughts/ideas/fixes would be great.
    Cheers.

    This link solved the problem
    https://discussions.apple.com/thread/4165985?start=15&tstart=0

  • How-do-i-configure-guest-wifi-access-using-2504-wlc-fortigate-utm-l3-device

    Dear All
    I have a 2504 Wireless Controller with multiple radios attached. I currently have a "private" WLAN configured (taking ip from windows server based DHCP of Range 192.1681.0/24 ) and working, but I need to add a Guest/Public WLAN which should take the IP from Other DHCP Configured on Fortigate UTM of range 172.16.0.0/24.
    We have one SG300 switch in the office and the rest are basic switches.
    Our firewall/router is a Fortigate UTM 240D
    Find the attached network diagram for the issue.
    Is there a SIMPLE way to enabling guest access that doesn't require VLANS (or are VLANS easier than I'm making them)? 
    Thanks.
    - See more at: https://supportforums.cisco.com/discussion/12473186/how-do-i-configure-guest-wifi-access-using-2504-wlc-fortigate-utm-l3-device#sthash.aj1XcWI0.dpuf

    Complete these steps in order to configure the devices for this network setup:
    http://www.cisco.com/c/en/us/support/docs/wireless-mobility/wireless-vlan/70937-guest-internal-wlan.html
    Configure Dynamic Interfaces on the WLC for the Guest and Internal Users
    Create WLANs for the Guest and Internal Users
    Configure the Layer 2 Switch Port that Connects to the WLC as Trunk Port

  • Can I create a Stored Procedure That access data from tables of another servers?

    I'm developing a procedure and within it I'm trying to access another server and make a select into a table that belongs to this another server. When I compile this procedure I have this error message: " PLS-00904: insufficient privilege to access object BC.CADPAP", where BC.CADPAP is the problematic table.
    How can I use more than one connection into an Oracle Stored Procedure?
    How I can access tables of a server from a Stored Procedure since the moment I'm already connected with another server?
    Can I create a Stored Procedure That access data from tables of another servers?

    You need to have a Database Link between two servers. Then you could do execute that statement without any problem. Try to create a database link with the help of
    CREATE DATABASE LINK command. Refer Document for further details

  • Dump - Access using NULL object reference is not possible!!!

    Hi,
    I'm using the BCS class for sending HTM format email so i use the below code for that its working,
    DATA: gr_document      TYPE REF TO cl_document_bcs,
    gr_document = cl_document_bcs=>create_document(
                          i_type    = 'HTM'
                           i_text    = t_html
                           i_importance = '5'
                           i_subject = gc_subject ).
    Next task is to send the image so i'm creating an another object to the same class, below code
    *Image from MIME
    DATA: o_mr_api         TYPE REF TO if_mr_api.
    DATA is_folder TYPE boole_d.
    DATA l_img1 TYPE xstring.
    DATA l_img2 TYPE xstring.
    DATA l_loio TYPE skwf_io.
    DATA: lo_document   TYPE REF TO cl_document_bcs.
    IF o_mr_api IS INITIAL.
       o_mr_api = cl_mime_repository_api=>if_mr_api~get_api( ).
    ENDIF.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/tick.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img1
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/Delete.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img2
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    *Convert XSTRING to ITAB
    DATA :lt_hex1 TYPE solix_tab,
           lt_hex2 TYPE solix_tab,
           ls_hex LIKE LINE OF lt_hex1,
           lv_img1_size TYPE sood-objlen,
           lv_img2_size TYPE sood-objlen.
    CLEAR : lt_hex1, lt_hex2, ls_hex, lv_img1_size, lv_img2_size.
    WHILE l_img1 IS NOT INITIAL.
       ls_hex-line = l_img1.
       APPEND ls_hex TO lt_hex1.
       SHIFT l_img1 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    WHILE l_img2 IS NOT INITIAL.
       ls_hex-line = l_img2.
       APPEND ls_hex TO lt_hex2.
       SHIFT l_img2 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    *Findthe Size of the image
    DESCRIBE TABLE lt_hex1 LINES lv_img1_size.
    DESCRIBE TABLE lt_hex2 LINES lv_img2_size.
    lv_img1_size = lv_img1_size * 255.
    lv_img2_size = lv_img2_size * 255.
    *Attach Images
    clear: lo_document.
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img1'                " Attachment Title
         i_attachment_size     =  lv_img1_size           " Size of Document Content
         i_att_content_hex     =  lt_hex1  " Content (Binary)
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img2'                " Attachment Title
         i_attachment_size     =  lv_img2_size           " Size of Document Content
         i_att_content_hex     =  lt_hex2  " Content (Binary)
    but it throws the dump " Access using NULL object reference is not possible"  when i tries to access for method add_attachment...
    Thanks,
    Siva

    Yes there is commit work after that, Below code
          gr_document = cl_document_bcs=>create_document(
                           i_type    = 'HTM'
                            i_text    = t_html
                            i_importance = '5'
                            i_subject = gc_subject ).
    *Image from MIME
    DATA: o_mr_api         TYPE REF TO if_mr_api.
    DATA is_folder TYPE boole_d.
    DATA l_img1 TYPE xstring.
    DATA l_img2 TYPE xstring.
    DATA l_loio TYPE skwf_io.
    DATA: lo_document   TYPE REF TO cl_document_bcs.
    IF o_mr_api IS INITIAL.
       o_mr_api = cl_mime_repository_api=>if_mr_api~get_api( ).
    ENDIF.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/tick.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img1
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    CALL METHOD o_mr_api->get
       EXPORTING
         i_url              = '/SAP/PUBLIC/ZDEMO/Delete.png'
       IMPORTING
         e_is_folder        = is_folder
         e_content          = l_img2
         e_loio             = l_loio
       EXCEPTIONS
         parameter_missing  = 1
         error_occured      = 2
         not_found          = 3
         permission_failure = 4
         OTHERS             = 5.
    *Convert XSTRING to ITAB
    DATA :lt_hex1 TYPE solix_tab,
           lt_hex2 TYPE solix_tab,
           ls_hex LIKE LINE OF lt_hex1,
           lv_img1_size TYPE sood-objlen,
           lv_img2_size TYPE sood-objlen.
    CLEAR : lt_hex1, lt_hex2, ls_hex, lv_img1_size, lv_img2_size.
    WHILE l_img1 IS NOT INITIAL.
       ls_hex-line = l_img1.
       APPEND ls_hex TO lt_hex1.
       SHIFT l_img1 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    WHILE l_img2 IS NOT INITIAL.
       ls_hex-line = l_img2.
       APPEND ls_hex TO lt_hex2.
       SHIFT l_img2 LEFT BY 255 PLACES IN BYTE MODE.
    ENDWHILE.
    *Findthe Size of the image
    DESCRIBE TABLE lt_hex1 LINES lv_img1_size.
    DESCRIBE TABLE lt_hex2 LINES lv_img2_size.
    lv_img1_size = lv_img1_size * 255.
    lv_img2_size = lv_img2_size * 255.
    *Attach Images
    create object lo_document type cl_document_bcs.
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img1'                " Attachment Title
         i_attachment_size     =  lv_img1_size           " Size of Document Content
         i_att_content_hex     =  lt_hex1  " Content (Binary)
    lo_document->add_attachment(
       EXPORTING
         i_attachment_type     =  'png'                  " Document Class for Attachment
         i_attachment_subject  =  'img2'                " Attachment Title
         i_attachment_size     =  lv_img2_size           " Size of Document Content
         i_att_content_hex     =  lt_hex2  " Content (Binary)
           "Add document to send request
           CALL METHOD gr_send_request->set_document( gr_document ).
           TRY.
             CALL METHOD gr_send_request->SET_SEND_IMMEDIATELY
               EXPORTING
                 I_SEND_IMMEDIATELY = 'X'.
    *    CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION .
    **Catch exception here
           ENDTRY.
           DATA: LO_SENDER TYPE REF TO IF_SENDER_BCS VALUE IS INITIAL.
           TRY.
             LO_SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ). "sender is the logged in user
    * Set sender to send request
             gr_send_request->SET_SENDER(
             EXPORTING
             I_SENDER = LO_SENDER ).
    *    CATCH CX_ADDRESS_BCS.
    ****Catch exception here
           ENDTRY.
           "Send email
           CALL METHOD gr_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE 'Email sent!'.
           ENDIF.
           "Commit to send email
           COMMIT WORK.
           "Exception handling
         CATCH cx_bcs INTO gr_bcs_exception.
           WRITE:
             'Error!',
             'Error type:',
             gr_bcs_exception->error_type.
       ENDTRY.

  • Thunderbird cannot open attachment after idle for several hours on Windows Terminal Server 2008 R2 Enterprise

    We are using Thunderbird on WTS2008 R1
    Cannot open attachment after thunderbird is launched for a short period of time. Tried to save attachment but the attachment saved actually comes with 0kb. Thunderbird works fine after restart itself, not sure if any settings can fix this?

    Hi Darrkon,
    I suggest checking the status of the HealthMailbox on each of servers.
    Also try to re-create the mailbox. You can safely delete and recreate health mailboxes.
    Be aware that any local Managed Availability probes that are using the these mailboxes will fail until the Microsoft Exchange Health Manager is restarted.  Once that service is restarted, it will recreate any mailboxes that it needs. 
    More details in the following similar thread, just for your reference:
    BSOD after creating DAG
    http://social.technet.microsoft.com/Forums/exchange/en-US/44d1cd98-cba1-4ed0-b0e7-8aa76ee3eabc/bsod-after-creating-dag
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • Open attachment

    Hi,
              I am using a servlet to open attachment in JavaMail. Part of the servlet
              I deal with attachment part is as following:
              if(disposition.equals(mbp.ATTACHMENT)) //mbp
              is MimeBodyPart object
              ServletOutputStream out =
              httpResponse.getOutputStream();
              InputStream is = mbp.getInputStream();
              filename = mbp.getFileName();
              try{
              ContentType ct = new
              ContentType(sct);
              httpResponse.setContentType(ct.getBaseType());
              catch (ParseException pe)
              pe.printStackTrace();
              httpResponse.setHeader("Content-Disposition", "attachment;
              filename="+filename);
              Read file content.........
              Here is the problem I am having now: In IE, when click on attachment
              link, an Open/Save as dialog will be poped up. If select Save As option,
              the default filename appeared in the Save as dialog box is my servlet
              name and the file type is .html, the content in this file is my current
              html page, instead of real attached file content. But it is ok to open
              the file, the content is attached file content.
              Any body has any good suggestions?
              Thanks.
              Meian
              

    Hi Daniel
    Assuming you still have PowerPoint installed on your system, drag the attached file out of the mail window onto the desktop. Select the file by clicking on it once in the Finder then select Get info from the File menu. Click the disclousure triangle to expand the Open with: section if it is not already showing. Use the pop up menu to choose PowerPoint, use the last 'Other...' option if PowerPoint is not listed and navigate to it through the standard browse dialogue box. (Select 'Enable ALL applications.' if necessary)
    Click Add when you find PowerPoint.
    This will relink this file to open with PowerPoint by default in the future.
    To make all documents with the same extension (.pps) also open with PowerPoint by default, click the 'Change All...' button in the Get info window.
    Cheers, Stephen.
    Edit: Yeah, what Jeff said. (Note to self: Must be more concise...) lol

Maybe you are looking for

  • OC4J Wireless standard apps missing

    Hi all, I got the following error in my opmn log. Checking the OCS4J_Wireless APPS in EM confirming that all the standard OC4J-Wireless apps are missing, I guess some of the developer when trying to redeployed their customer apps hv accidently delete

  • Problems with Front Row

    I just got the new intel iMac but everytime I try to watch movie trailers it goes directly to the "Movie trailer server not responding" screen. It doesnt even seem to try to connect. Anyone else have this issue?

  • Help in  SOAP to SOAP scenario

    Hi.. can anyone give me a clear idea or if u already have any blogs which will give me a detailed information about a Soap to soap scenario and how will it be possible to handle errors. help me out in understanding a  SOAP scenario. reward points if

  • TS1424 100 error? Credit Card Processing down for 4 hours

    Any Clue? Attempting to buy Numbers and Keynote. Getting a 100 error followed by cc processing down. It has been 4 hours ...

  • 2 separate clickboxes each with a separate response

    I guess I didn't explain the problem very well.  I am trying to do a check on learning.  To respond to the scenario I want the student to click on the correct response.  I created 2 objects for permissible and non-permissible.  I also created a click