DataObject.QueryAdapter Property

InfoPath Developer Reference

A read-only property that returns a reference to the data adapter object that is used for a secondary data source. Read-only

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.QueryAdapter

expression   An expression that returns a DataObject object.

Return Value
Object

Remarks

After you have set a reference to the data adapter object that the QueryAdapter property returns, you can use the properties and methods that the particular data adapter object contains.

Microsoft Office InfoPath 2007 supports three types of data adapters:

  1. ActiveX Data Objects, represented by the ADOAdapter object.
  2. Web services, represented by the WebServiceAdapter object.
  3. XML file, represented by the XMLFileAdapter object.
Bb250842.vs_note(en-us,office.12).gif  Note
The XMLFileAdapter object cannot be used with the QueryAdapter property of the XDocument object, it is only used for secondary data sources. To access a form's underlying XML document, use the DOM property of the XDocument object.

Security Level 2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Example

In the following example, the QueryAdapter property of the DataObject object is used to return a reference to the data adapter that is associated with the DataObject object, which, in this case, is an ADOAdapter data adapter object. The code then uses the Command property of the ADOAdapter object to display the SQL command text in a message box:

JScript
  var objDataAdapter;

objDataAdapter = XDocument.DataObjects("CityList").QueryAdapter; XDocument.UI.Alert("SQL command text: " + objDataAdapter.Command);

See Also