QueryDB Problems - InfoPath Dev
in

InfoPath Dev

QueryDB Problems

Last post 04-02-2010 06:16 AM by ErnestoM. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-22-2010 11:07 AM

    QueryDB Problems

    Hello -

    I followed these instructions to the letter http://www.infopathdev.com/files/folders/web_methods/entry32474.aspx

     yet I am getting an error.  I am trying a dynamic query

    here is the sample query:
    <query database='#CORLOG#' table='vendor-tbl' maxrows='2'><columns><column name='VENCONTR'/><column name='VENNO'/></columns></query>

     I put this in the the sample value when I am setting up the data connection for GetColumnsXMLStrQuery.

     When I setup the field In the rules I use the set a field value and use this query:

    concat("<query database='CORLOG' table='vendor-tbl' maxrows='1'><columns><column name='VENCONTR'/><column name='VENNO'/></columns><filter><eq><column name='VENCONTR'/><value>", xdXDocument:get-DOM()/my:myFields/my:ContractAgreementNumber ,"</value></eq></filter></query>")

    I am referencing a field in the form as my "where" clause.  I add the rule to query database after the set field value.

    The error that I get is Some rules were not applied.

    here is the detailed error:

    The query cannot be run for the following DataObject: GetColumnsXMLStrQuery
    InfoPath cannot run the specified query.
    The SOAP response indicates that an error occurred on the server:

    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Invalid parameter
    Parameter name: queryXml ---> System.ArgumentException: Invalid parameter
    Parameter name: queryXml
       at Qdabra.DataBaseService.QueryDBService.GetColumnsXMLStrQuery(String queryXml)
       --- End of inner exception stack trace ---
       at Qdabra.DataBaseService.QueryDBService.GetColumnsXMLStrQuery(String queryXml)
       --- End of inner exception stack trace ---

    I am not sure how to trouble shoot the invalid parameter.

  • 03-22-2010 06:46 PM In reply to

    That error typically means that the queryXml parameter is not valid (well-formed) XML.

    Can you try displaying the queryXml value in a TextBox on your form (just drag the field into your form and display it as a text box) so you can see what value it has when the query is being run, then copy and paste it into this forum?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-02-2010 06:16 AM In reply to

     Also, comparing your query strings I notice:

    • you're using #CORLOG# in one and CORLOG in the other (for the database parameter).
    • You have a maxrows of 1 in the concat statement. If you are filtering, and you expect to only find one matching value, then the maxrows parameter won' t be necessary.

    <query database='#CORLOG#' table='vendor-tbl' maxrows='2'><columns><column name='VENCONTR'/><column name='VENNO'/></columns></query>

    concat("<query database='CORLOG' table='vendor-tbl' maxrows='1'><columns><column name='VENCONTR'/><column name='VENNO'/></columns><filter><eq><column name='VENCONTR'/><value>", xdXDocument:get-DOM()/my:myFields/my:ContractAgreementNumber ,"</value></eq></filter></query>")

    I would suggest addressing both to make sure you don't run into other issues later.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


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