Hello,
Here is my current scenario.
I have Three Text Fields (not repeating) on the screen that a user enters data into. I have a COMMIT button at the bottom.
Note: All three of these fields are from my MAIN data source, not a secondary, and if possible I would like them to be on the MAIN data source.
In SQL Server I have a Stored Procedure that gets executed by:
execute stp_InsertNewAccountRecord 'Test Account','TAC','6/28/2006'
In the COMMIT button's event handler I have the following code that fills Three String Variables.
-----------------------------------------------------------------
AccountName = thisXDocument.DOM.selectSingleNode("//my:myFields/my:sec_AccountDetails/my:txt_AccountName").text
AccountCode = thisXDocument.DOM.selectSingleNode("//my:myFields/my:sec_AccountDetails/my:txt_AccountCode").text
AccountStartDt = thisXDocument.DOM.selectSingleNode("//my:myFields/my:sec_AccountDetails/my:txt_AccountStartDt").text
-----------------------------------------------------------------
I have seen examples where fields were on a Second Data Source and the Stored Procedure was executed using something like:
-----------------------------------------------------------------
thisXDocument.QueryAdapter.Command = "execute stp_InsertNewAccountRecord " + "'" + AccountName + "','" + AccountCode + "','" + AccountStartDt + "'"
thisXDocument.Query()
-----------------------------------------------------------------
How can I execute the Stored Procedure in my scenario.
Thank you in advance to anyone who can help me, this is my 2nd day in InfoPath!