S
sam1996
Hi All,
I am frustrated with trying to execute a stored procedure from InfoPath. I
am trying to filter out a table into a repeated table form and the stored
procedure does not execute. Any help or direction on this issue will be
appreciated. I have looked at most all of the infopath forums about executing
a sp and still cannot make it work. I do not know what I am doing wrong...
Details are below:
bankname is the parameter I am passing into the sp...
Below is the JScript for the filter button on the infopath form..
function CTRL2_8::OnClick(eventObj)
{
//Retrieve the value of the field that you want to use as a parameter
//to the stored procedure.
var bankname =
XDocument.DOM.selectSingleNode("/dfs:myFields/my:bankname").text;
//Set the Command for the Query Adapter of the Data Source. Incorporate the
//parameter values that you want to use.
XDocument.QueryAdapter.Command = 'execute CBOReport ' + "'" + bankname + "'";
XDocument.UI.Alert(XDocument.QueryAdapter.Command);
//Query the Data Source.
XDocument.Query();
}
Here is the stored Procedure:
Create PROCEDURE [dbo].[CBOReport]@bankname varchar(25)
AS
BEGIN
SELECT ACIF, BankName, [Name], SUM(ISNULL(Balance, 0) + ISNULL(Unfunded, 0))
AS Balance, SUM(Counter) AS Counter
FROM tblELCAlertProductionData
where bankname = @bankname
GROUP BY ACIF, BankName, [Name]
HAVING (SUM(Counter) >= 3)
ORDER BY Counter, Balance
END
Below is the InfoPath Error:
The following error occurred:
The query method on the Document object failed.
InfoPath cannot run the specified query.
The XML data returned from the data source does not match the XML Schema for
this form. This discrepancy might be caused by the data source returning
multiple rows when InfoPath expects only one.
I am frustrated with trying to execute a stored procedure from InfoPath. I
am trying to filter out a table into a repeated table form and the stored
procedure does not execute. Any help or direction on this issue will be
appreciated. I have looked at most all of the infopath forums about executing
a sp and still cannot make it work. I do not know what I am doing wrong...
Details are below:
bankname is the parameter I am passing into the sp...
Below is the JScript for the filter button on the infopath form..
function CTRL2_8::OnClick(eventObj)
{
//Retrieve the value of the field that you want to use as a parameter
//to the stored procedure.
var bankname =
XDocument.DOM.selectSingleNode("/dfs:myFields/my:bankname").text;
//Set the Command for the Query Adapter of the Data Source. Incorporate the
//parameter values that you want to use.
XDocument.QueryAdapter.Command = 'execute CBOReport ' + "'" + bankname + "'";
XDocument.UI.Alert(XDocument.QueryAdapter.Command);
//Query the Data Source.
XDocument.Query();
}
Here is the stored Procedure:
Create PROCEDURE [dbo].[CBOReport]@bankname varchar(25)
AS
BEGIN
SELECT ACIF, BankName, [Name], SUM(ISNULL(Balance, 0) + ISNULL(Unfunded, 0))
AS Balance, SUM(Counter) AS Counter
FROM tblELCAlertProductionData
where bankname = @bankname
GROUP BY ACIF, BankName, [Name]
HAVING (SUM(Counter) >= 3)
ORDER BY Counter, Balance
END
Below is the InfoPath Error:
The following error occurred:
The query method on the Document object failed.
InfoPath cannot run the specified query.
The XML data returned from the data source does not match the XML Schema for
this form. This discrepancy might be caused by the data source returning
multiple rows when InfoPath expects only one.