Share via


query Element (dataObject Element)

Associates a data adapter with a data object.

Type

  xsd:complexType

Parent Elements

Element Description
dataObject Defines a secondary data object that is used in a Microsoft Office InfoPath form.

Child Elements

Element 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.
sharepointListAdapter (Optional element) Contains the data adapter information to query a SharePoint list or library.

Attributes

None.

Definition

  <xsd:element name="query" >
  <xsd:complexType>
    <xsd:choice>
      <xsd:element ref="xsf:adoAdapter" />
      <xsd:element ref="xsf:webServiceAdapter" />
      <xsd:element ref="xsf:xmlFileAdapter" />
      <xsd:element ref="xsf:sharepointListAdapter" />
    </xsd:choice>
  </xsd:complexType>
</xsd:element>

Remarks

Example

The following is an example of the query element:

  <xsf:dataObjects>
 <xsf:dataObject 
  name="EmployeeNames"
  schema="EmployeeNames.xsd"
  initOnLoad="yes">
  <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>
 </xsf:dataObject>
</xsf:dataObjects>