Just wondering if anyone can point me at how to do this? I am unable to create a connection that will let me do more than query the DB.
From this post by Hilary:
http://www.infopathdev.com/blogs/hilary/archive/2009/10/13/use-dbxl-submit-with-existing-sql-data.aspx
I read the last paragraph:
An Alternate Route
For the programmer, or if you don't mind the maintenance costs of adding code to your forms, there are other alternatives. For example, you can use custom code for your submit that will run a stored procedure or SQL statement to delete any rows that have the same ID as the data loaded into your form prior to the web service submit. This works well for data that has been using unique identifiers for keys.
Which makes me think it can be done but my sampling does not make it readily apparent. I have tried this:
string deleteTableQry = "DELETE FROM [dbo].[MyTable] WHERE MyKey='" + someKeyVar + "'";
AdoQueryConnection myAdoQueryConnection =
(AdoQueryConnection)(this.DataConnections["DB_CONNECTION_TO_MYDB"]);
string oldCmd = myAdoQueryConnection.Command;
myAdoQueryConnection.Command = deleteTableQry;
myAdoQueryConnection.Execute();
myAdoQueryConnection.Command = oldCmd; The command runs but doesn't seem to change anything in the DB.
Anyone with suggestions?
Thx,
Rob