I have recently upgraded a working system from Windows XP
and Office 2003 to a Windows 7 and office 2007.
I have two buttons that call stored procedures in SQL
“Copyinsert” which is essentially a save as routine and a “Findformula” which
will locate a given formula.
“Findformula” works
wonderfully
“Copyinsert” Does not work
I can trigger the “Copyinsert” stored proc from other means
and it works fine, but I cannot get it to work from Infopath
Button Code:
XDocument.DOM.setProperty("SelectionNamespaces",
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-06-08T14:01:43"
xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"'); //
function CopyInsert::OnClick(eventObj)
{
var RecipeNew =
XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Formulas/@FormulaNumber").text;
var RecipetoCopy =
XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Formulas/@FormulaNumber").text;
XDocument.QueryAdapter.Command = "CopyInsert " +
"'" + RecipetoCopy +
"',"+"'"+RecipeNew+"'";
XDocument.Query(); }
function
FindFormula::OnClick(eventObj)
{
var Formula =
XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Formulas/@FormulaNumber").text;
XDocument.QueryAdapter.Command = "QueryFormula " +
"'" + Formula+"'";
XDocument.Query(); }
Please help!!