Undefined XML Schema??

D

DrRocket

Can anyone tell me how I can define the schema of an infopath form
through code? I run this code on the press of a button and i get an
error that infopath cannot load the form because its schema is
undefined. How do I link a forms schema to the schema in the template
of that form? Thanks.

function CTRL31_45::OnClick(eventObj)
{
ConnectToDatabase()

var strSQL = "SELECT Projects.ProjectID FROM Projects WHERE
Projects.Reviewed = Yes AND Projects.Approved = No"

var pobjRS = pobjConnection.Execute(strSQL);

if(!pobjRS.eof)
{
pobjRS.movefirst;

var FormName = "J:\\Dudley\\InfoPath\\Reviewed\\ProjectID - " +
pobjRS.fields("ProjectID").value + ".xml"

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
var objSampleDataDOM = XDocument.DOM;
var strSelectionNamespaces = objSampleDataDOM.getProperty
"SelectionNamespaces");

xmlDoc.load(FormName);
xmlDoc.setProperty("SelectionNamespaces",strSelectionNamespaces)
xmlDoc.async = false
xmlDoc.validateOnParse = false;

XDocument.ImportDOM(xmlDoc);
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top