SQL connection from Infopath - InfoPath Dev
in

InfoPath Dev

SQL connection from Infopath

Last post 03-20-2012 03:09 AM by skyshield. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-06-2012 01:10 AM

    SQL connection from Infopath

    Hi,

    it has been now 2 weeks that i discovered infopath.

    I know some programming language like MySQL but it has been quite some time that i have used it.

    Also i am not familiar with Infopath. For now i could get data out of a database by doing the trial and error way.

    My problem starts here.

    I need to get info from a second database.

    I have SH SP Material number and Material Name in the database.

    The SH is a customer number that is also the number i enter to query the data from the first database(that part works)

    First when i start i get the whole second database loaded in a list box even before entering the SH called txtShipto in a text box.

    What i intent to do and i am fiddling around hopelessly already is when i call up the customer number in txtShipto textbox that the list box shows up only the values that equal the txtShipto number i have entered.

    For now as said it loads the database comletely in the list box but when i query the txtShipto this list shows the material number i search. Problem is...

    it shows only one material and it keeps the other data from the database listed.

    I would apreciate much your expert help here in order to solve the problem and to learn more about Infopath.

    My listbox has this rule

    Query using the second database

    set field value .= @SH[. = txtShipto]

    List box Propreties

    /dfs:myFields/dfs:dataFields/d:customer material

    Value @SH

    display name @MatName

     

    Oh... by the way.... is it possible to show 2 data in the list box like Material number and the Material name? Right now i only get the Material name.

     

    Again thanks a lot in advance.

     

    Mike

      

     

     

  • 03-08-2012 12:09 PM In reply to

    Re: SQL connection from Infopath

    Hi:

    Well, I'm confused by the set field value rule.

    In general, what you need to do is add a filter when selecting the repeating data source node for the values for your list box.

    If you want to concatenate data for use as a drop down display or value, you'll need to do that in a view and then use the view as your secondary data source.

    Hope this helps?

    Hilary Stoupa

  • 03-20-2012 03:09 AM In reply to

    Re: SQL connection from Infopath

    Hi Hilary Thanks that you replied. I have been away a few days.

     During the holidays i saw that i can use javascript to make queries.

     I also found your example with the Cars and Dealers you made in C and Javascript.

     I tried to figure out how you made it to populate the repeating table and i understood a few things.

    Bad thing is i dont understand the DOM thing and how you query.

     Looks like you build the table first in XML and then you fill it in with the actual query from the XMLlist and them you join that in the repeating table.

    I dont know if i can use the same setup to query a field from a mysql database and get the data out of it.

    I would like to ask you kindly if you can show me the easyest way in populating a repearing table with javascript out of a mysql database.

    With your example i have more knowledge than i had a week ago but still want to learn more.

    If you share an easy sample i will be able to build on it and learn from it.

    I have a txt box called txtShipto.

    a segondary conection called Sales_Volume_mountly (the sql database)

     

    If you dont want to put code maybe if you could explain the steps with all the XDocument.DOM things....

    SingleNode if i understood is like selecting the cell. 

    Or if you can point me to a place where the information is easy to understand.

     

    Thank you very much for your time.

    Mike 

     

     

     

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