Accessing an Access DB - InfoPath Dev
in

InfoPath Dev

Accessing an Access DB

Last post 05-04-2006 02:51 AM by Taffman. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-27-2006 07:44 AM

    • Jerry
    • Not Ranked
    • Joined on 04-17-2006
    • USA
    • Posts 14

    Accessing an Access DB

    Please forgive me if the answer to my question has already been answered, but I could not find the answer, so here goes:

    I created a nice Purchase Order form using InfoPath, and placed it on our Sharepoint site. I now need to access an Access DB, located on another shared server. The data in the Access DB is for budgeting purposes, the Purchase Orders are cut against say 100 Budget items, containing some data I want to be able download into some fields in my form. When I connect to the Access DB, I would want all of the 100 Budget items to be listed, then be able to select the one I want by clicking on the item and have the data in that item populate 5 Read Only fields in my form. For example, the Access DB would look something like this:
    Budget PO#, Activity #, Category, Budget Amt, Avail Bal
    14700069999, 001, EQOFF, 1500.00, 750.00
    14700063621, 001, EQOFF, 3000.00 3000.00
    14700067895, 001, EQOFF, 2000.00 0.00

    Can someone point me in the right direction to figure out how to do this? I don't care about updating the DB, just to see all the items in it, select the applicable Budget PO#, and download the data in that PO into my InfoPath form.
  • 04-27-2006 10:29 AM In reply to

    Hi Jerry,

    You can use a secondary data source (your Access DB located on a different shared server) to do this.

    Here is a really good how-to that Matt Faus wrote that I think should point you in the right direction:

    http://infopathdev.com/howto/tutorials/default.aspx?i=9111ef580f95479890fc18fb2c5bac85

    Good luck!

    Ted

  • 04-27-2006 10:32 AM In reply to

    Hi Jerry,

    Check out this tutorialhttp://infopathdev.com/howto/tutorials/default.aspx?i=0bb37b4de44348408680a53a449f2353 , especially the instructions under "Add a supplementary data connection to the same database"
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-27-2006 11:11 AM In reply to

    • Jerry
    • Not Ranked
    • Joined on 04-17-2006
    • USA
    • Posts 14
    Thanks SO MUCH guys.... I'll check it out. :-)
  • 04-27-2006 02:39 PM In reply to

    • Jerry
    • Not Ranked
    • Joined on 04-17-2006
    • USA
    • Posts 14
    Matt... in your tutorial... in the section where you said to "Add code behind the View Detail button", I apparently are not performing Step 3 correctly. That's where I am to replace the contents of the
    OnClick event handler with your code. Currently the template reads as
    "function btnViewDetail::OnClick(eventObj)
    {
    // Write your code here
    }

    What do I need to remove? Do I insert your code you suggested into the area where it says "// Write your code here"?
  • 05-01-2006 12:04 PM In reply to

    • Jerry
    • Not Ranked
    • Joined on 04-17-2006
    • USA
    • Posts 14
    Matt.... when I enter the following code, per your example, I get an error message which says... "Object required". There must be something wrong with the code? Line 24... where it starts out as "oQueryID.text = eventObj.Source.selectSingleNode...

    // The following function handler is created by Microsoft Office InfoPath.
    // Do not modify the name of the function, or the name and number of arguments.
    //=======
    function btnViewDetail::OnClick(eventObj){var oQueryId = XDocument.DOM.selectSingleNode
    ("/dfs:myFields/dfs:queryFields/q:Customers/@CustomerID" );
    oQueryId.text = eventObj.Source.selectSingleNode("@CustomerID").text;
    XDocument.Query();
    XDocument.View.SwitchView("Detail");}
  • 05-04-2006 02:51 AM In reply to

    Hears a real dumb question, but I'll ask it anyway. I totally understand how to create a secondary XML data source and it works well for me locally.

    When I get round to publishing by form on sharepoint, are the secondary datasources added to my form embedded in the form and therefore will move with the form when I publish, or co I have to copy these datasources seperatly to the sharepoint (or other)location.

    Second dumb question, if the secondary data source is an Access Database, is this type of datasource also embedded in the form as per XML or should this be moved seperatly?
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.