Show All

# query Element

Associates a data adapter with a data object or a form's underlying XML document.

## Type

    xsd:complexType

## Structure

Name | Description
--- | ---
adoAdapter | (Optional element) Defines an ActiveX Data Objects (ADO) data adapter that retrieves data from an ADO data source for the specified data object.
webServiceAdapter | (Optional element) Defines a Web service data adapter that retrieves data from a Web service for the specified data object.
xmlFileAdapter | (Optional element) Defines an .xml file data adapter that retrieves data from an .xml file for the specified data object.
queryAction | (Optional element) Defines a data connection query action.
sharepointListAdapter | (Optional element) Contains the data adapter information to query a SharePoint list or library.

## Remarks

The query element is an optional element of the xDocumentClass element and the dataObject element.

Only one data adapter can be specified in the query element.

## Example

The following is an example of the query element:

    <xsf:query>
       <xsf:adoAdapter
          connectionString="Provider=Microsoft.Jet.OLEDB.4.0;
             Password=&quot;&quot;;User ID=Admin;
             Data Source=infnwind.mdb;Mode=Share Deny None;
             Extended Properties=&quot;&quot;;..."
          commandText="select [EmployeeID],[LastName],[FirstName]
             from [Employees] as [Employees]"
          queryAllowed="yes"
          submitAllowed="yes">
       </xsf:adoAdapter>
    </xsf:query>

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp