in

InfoPath Dev

Handling File Attachments on form with Access Data Source

Last post 05-09-2007 09:55 AM by Clay Fox. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-08-2007 10:01 AM

    Handling File Attachments on form with Access Data Source

    Hi,

    I'm using Infopath for the first time and cant seem to figure out how to handle file attachments on my form.  I am using an access database as my data source but on my form, which is a project request form, and I'd like to have a section where the user can upload whatever attachments may be be needed to complete the request. So I created a new field and change the file type to attachment in the data source. However, data connections to a database do not allow me to submit this field.  So I decided to create a second data connection that would submit it to my email instead.  But this isnt working either.  So then I used some VBscript to do this but it errors out at the attachments.add line.  Is my data source field referenced correctly?  If not can somebody give me a heads up on what wrong with it.  Also if anyone has any ideas on how to solve this any other way, that would be great. Thanks!

     

    Sub CTRL60_4_OnClick(eventObj)

    Dim objOutlook

    Dim objOutlookMsg

    Dim objOutlookRecip

    Dim objOutlookAttach

    Dim frmSavePath 'Create the Outlook session.

    Set objOutlook = CreateObject("Outlook.Application") Set objOutlookMsg = objOutlook.CreateItem(0) 'olMailItem

     

    With objOutlookMsg 'Add the To recipient(s) to the message.

     

    Set objOutlookRecip = .Recipients.Add("my email")

    objOutlookRecip.Type = 1 'olTo

    .Subject = "This is an Automation test with Microsoft Outlook"

    .body = "This is the body of the message"

    .Importance = 2 'High importance

    'Resolve each Recipient's name.

    For Each objOutlookRecip In .Recipients

    objOutlookRecip.Resolve

    Next

    Set objOutlookAttach = .Attachments.Add(XDocument.DOM.selectSingleNode("/my:myFields/my:Attachments"))

    Display the message before sending

    .display

    End With

    Set objOutlook = Nothing

    Set objOutlookMsg = Nothing

    Set objOutlookRecip = Nothing

    Set objOutlookAttach = Nothing

    End Sub

  • 05-08-2007 01:29 PM In reply to

    Re: Handling File Attachments on form with Access Data Source

    Attachments are difficult without web services.  I would recommend you look at the Database Accelerator, this is a web service suite which installs on your server, which can be sql 2005 express.  This gives you the ability to store your forms in SQL server, extract your data into tables, and have active directory and Sharepoint integration. I would check it out and see if it wouldn't make development of your form solution much faster and easier.

    http://www.qdabra.com/proddetail.asp?prod=QDBXL1

    I have used DBXL to do exactly what you are talking about, having InfoPath Forms with embedded attachments and being able to extract them to a database.

     

    Filed under: ,
  • 05-09-2007 09:34 AM In reply to

    Re: Handling File Attachments on form with Access Data Source

    Thanks for the response Clay.  I've got another issue that I could really use some help on as well.  Since this is my first time using infopath I'm sure I'm not setting things up the right way.  What I've done is I have a default view that is a project request form that someone can fill it out and it submits to my database.  I then have a query view that has all the queryfields on it so that someone can query the database with whatever information they have.  My run query button then switches to another view runs the query and displays the query results.  I set up all of the controls in this view in sections instead of repeating sections because my boss didnt like how it looked originally.  However, this limits my results in this view to the first record that was queried.  What I would really like to do is have a next button at the bottom of this view that would display the information from the next record that matches the query criteria much like a movenext command on a recordset would but I can't figure out how to do this.  Any suggestions.
  • 05-09-2007 09:55 AM In reply to

    Re: Handling File Attachments on form with Access Data Source

Page 1 of 1 (4 items)
Copyright © 2003-2007 Qdabra Software. All rights reserved.
View our Terms of Use.