_XDocument4.QueryAdapter property
Gets a reference to the data adapter object that is associated with a Microsoft InfoPath form.
Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)
Syntax
'Declaration
ReadOnly Property QueryAdapter As Object
Get
'Usage
Dim instance As _XDocument4
Dim value As Object
value = instance.QueryAdapter
Object QueryAdapter { get; }
Property value
Type: System.Object
Returns Object.
Implements
Remarks
Data adapter objects provide different properties and methods that retrieve and submit data to external data sources; the data adapter that is associated with a form is dependent on the type of data source that was used when the form was initially created.
The QueryAdapter property allows you to access an InfoPath form's primary data source. To access the data adapter objects used for a form's secondary data sources, use the DataObjects property.
Examples
In the following example, the QueryAdapter property of the XDocument object is used to set a reference to the ADOAdapterObject object; then the Command property of the ADOAdapter object is used to display the SQL command text in a message box:
ADOAdapter2 adapter;
adapter = (ADOAdapter2) thisXDocument.QueryAdapter;
thisXDocument.UI.Alert("SQL command text: " + adapter.Command);