Export (0) Print
Expand All
Expand Minimize

dataObject Element

Office 2007

Defines a secondary data object that is used in a Microsoft Office InfoPath 2007 form.

Type

xsd:complexType

Structure

NameDescription
initOnLoad(Optional attribute) Specifies whether the data object should be initialized on document load.
name(Required attribute) The unique name for the data object.
schema(Optional attribute) The name of an XML Schema file.
query(Required element) Associates the data adapter with the data object or a form's underlying XML document.

Remarks

The dataObject element is an optional element of the dataObjects element.

Multiple dataObject elements are allowed within a form. Each data object is an XML Document Object Model (DOM) populated from an external data source that can be accessed directly (by name) from the XSL Transformation (XSLT)–based view code and any script-based business logic code in the form.

Example

The following is an example of the dataObject 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>


Community Additions

ADD
Show:
© 2014 Microsoft