Secondary data source... PROBLEM!!! - InfoPath Dev
in

InfoPath Dev

Secondary data source... PROBLEM!!!

Last post 04-17-2007 11:02 AM by Shiva. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-12-2007 09:38 AM

    Secondary data source... PROBLEM!!!

    Hello,
    i'm sorry for my terrible english...
    this is my code and I don't know why return 0...The right answer is 10!!!

    PERSONALE is a repeating table.
    "ALI" is a secondary datasource from ACCESS DB

    The first query (XDocument.DataObjects("ALI").QueryAdapter.Query) works well.


    XDocument.DataObjects("ALI").QueryAdapter.Query

    Set persone = XDocument.GetDOM("ALI").selectNodes("//PERSONALE")
    XDocument.UI.Alert(persone.length)


    This is ALI's structure:

    myFields
    __dataFields
    ____d:PERSONALE (repeating)
    ______:NR
    ______:COGNOME
    ______:NOME
    ______:SOCIETA
    ______:AREA
    ________AREE_REPARTO
    _________:ID
    _________:area
    _________:reaprto
    _________:note
    _________:UBICAZIONE


    Thanks,
    Checco.
  • 04-12-2007 10:38 AM In reply to

    Re: Secondary data source... PROBLEM!!!

    You are not using the require namespace. There are plenty of resources available if you need to look up information about namespaces to understand them.

    Basically "PERSONALE" is different than "d:PERSONALE"... that's why it can't find what you are looking for.
  • 04-17-2007 11:02 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Secondary data source... PROBLEM!!!

    Hi,

    You need to set the property of the ‘ALI’ secondary DOM first before you are trying to get the node list.

    For that one you need to use below code.

    //Get the secondary DOM
    Xdocument2 secondaryDOM = (Xdocument2)XDocument.GetDOM("ALI")

    //Set the property of secondary DOM
    secondaryDOM.setProperty("SelectionNamespaces", “Name space of the Secondary DOM”)
    Set persone = XDocument.GetDOM("ALI").selectNodes("//PERSONALE")
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.