Yesterdays Webcast: Database Connectivity in InfoPath Throug ADO.N

  • Thread starter Marcel Spring (Switzerland)
  • Start date
M

Marcel Spring (Switzerland)

Is the demo code (especially the used different WebServices) available for
download somewhere?

I would be interested to check out all the different approaches shown
yesterday. btw: This was a very interesting WebCast, to bad Hagen had to
hurry that much towards the end. Thanks for elaborating all the "fine print"
where developers usually struggle!
 
T

Tom Curtin

I watched the webcast but didn't get as much about ADO.Net or ADO with
infopath as I'd hoped. It was very web services oriented. None the less,
here's some code I worked out to update a secondary data source... To use
this kind of code in a form you must use the MSI installer and make the form
fully trusted otherwise you get an "access denied"

function updatemaster(id,mystat,age)
{
var memberdb = XDocument.DOM.selectSingleNode("//my:mbrsource").text;
adoConnection = Application.NewADODBConnection();
connectstring = "Provider=Microsoft.jet.OLEDB.4.0;Data Source='" + memberdb
+"'";
adoConnection.Open(connectstring);
mystat = "A"
var SQL = "UPDATE tblADCMBR SET INDISTAT='"+mystat+"' WHERE MBRID='"+id+"'";
adoConnection.Execute(SQL);
adoConnection.Close();
XDocument.DataObjects("tblADCMBR").Query();
XDocument.ForceUpdate;
}
 
Top