Share via


_XDocument3.QueryAdapter Property

Gets a reference to the data adapter object that is associated with a Microsoft Office 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 _XDocument3
Dim value As Object

value = instance.QueryAdapter
Object QueryAdapter { get; }

Property Value

Type: System.Object
A reference to the data adapter object that is associated with a form.

Implements

_XDocument2.QueryAdapter

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);

See Also

Reference

_XDocument3 Interface

_XDocument3 Members

QueryAdapter Overload

Microsoft.Office.Interop.InfoPath Namespace