Interfaccia XMLFileAdapterObject
Rappresenta una connessione a un file XML.
Spazio dei nomi: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)
Sintassi
<CoClassAttribute(GetType(XMLFileAdapterObjectClass))> _
<GuidAttribute("096CD5D5-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface XMLFileAdapterObject
Inherits XMLFileAdapter2
Dim instance As XMLFileAdapterObject
[CoClassAttribute(typeof(XMLFileAdapterObjectClass))]
[GuidAttribute("096CD5D5-0786-11D1-95FA-0080C78EE3BB")]
public interface XMLFileAdapterObject : XMLFileAdapter2
Osservazioni
Questo tipo è un wrapper per una coclasse richiesta dal codice gestito per l'interoperabilità COM. Utilizzare questo tipo per accedere ai membri dell'interfaccia COM implementata dalla coclasse. Per informazioni sull'interfaccia COM e un collegamento alle descrizioni dei relativi membri, vedere XMLFileAdapter2.
L'oggetto XMLFileAdapterObject è un tipo di adattatore dati di Microsoft Office InfoPath 2003 contenente tutte le informazioni necessarie per il recupero di dati da un'origine dati esterna.
L'oggetto XMLFileAdapterObject rende disponibile la proprietà FileURL, che può essere utilizzata per ottenere o impostare l'URL (Uniform Resource Locator) del file XML utilizzato come origine dati esterna.
Per le origini dati secondarie, è possibile accedere all'oggetto XMLFileAdapterObject tramite la proprietà QueryAdapter dell'oggetto DataSourceObject e tramite la proprietà Item dell'insieme DataAdaptersCollection.
È possibile accedere agli oggetti DataObject tramite la proprietà DataObjects dell'oggetto XDocument.
Esempio
DataAdapters dtaAdapters;
dataAdapters = thisDocument.DataAdapters;
XMLFileAdapterObject queryXMLFile = dataAdapters["form1"] as XMLFileAdapterObject;
if (queryXMLFile == null)
{
thisXDocument.UI.Alert("The DataAdapter does not exist or is not an XMLFileAdapterObject.");
}
else
{
thisDocument.UI.Alert("Query - XML file adapter");
thisDocument.UI.Alert("Name: " + queryXMLFile.Name);
thisDocument.UI.Alert("QueryAllowed: " + queryXMLFile.QueryAllowed);
thisDocument.UI.Alert("SubmitAllowed: " + queryXMLFile.SubmitAllowed);
thisDocument.UI.Alert("FileURL: " + queryXMLFile.FileURL);
// Perform the query.
try
{
queryXMLFile.Query();
}
catch (Exception ex)
{
thisXDocument.UI.Alert("Failed to query.\n\n" + ex.Message);
}
// Perform the submit.
try
{
queryXMLFile.Submit();
}
catch (Exception ex)
{
thisXDocument.UI.Alert("Failed to submit.\n\n" + ex.Message);
}
}
Vedere anche
Riferimenti
Membri XMLFileAdapterObject
Spazio dei nomi Microsoft.Office.Interop.InfoPath