I'm trying to update a secondary data connection from inside javascript code connected to a button. SQLserver database
I know SQL, but cannot get this update statement to work. updatedate is a valid datetime variable. Code segment -----
- var query = "update TRANSMARTSPOD SET [EmailDate] = " + updatedate + " ; commit; ";
- XDocument.DataObjects("TRANSMARTSPOD").DOM.setProperty("SelectionNamespaces",'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" ');
- XDocument.DataObjects("TRANSMARTSPOD").QueryAdapter.Command = query;
- XDocument.DataObjects("TRANSMARTSPOD").QueryAdapter.Query();
Error message during form preview is
"The query cannot be run for the following DataObject: TRANSMARTSPOD
InfoPath cannot run the specified query.
[0x80040E14][Microsoft OLE DB Provider for SQL Server] Incorrect syntax near '52'.