# PTQuerySourceType complexType

Describes the data source on which the query table or PivotTable is based.

## Type Information

Namespace | urn:schemas-microsoft-com:office:excel
Schema name | XML Spreadsheet 2000

## Elements and Attributes

### Child Elements

Element | Description
--- | ---
QueryType | Specifies the query mechanism to use.
CommandText | Specifies the text of the command to submit to the data source.
CommandType | Specifies the type of command used in the CommandText element.
Maintain | Specifies that a connection to the data source be left open after data is retrieved.
Connection | Specifies the text that defines the connection to the data source.
Parameter | Specifies the parameters to the command text.
CommandTextOrignal | Specifies the original text of the command to submit to the data source. Used only for PivotTable views when server-based page fields are used.
SourceConnectionFile | Specifies the name of the query file that was used to query the data source.
SourceDataFile | Contains the name of source data file (such as an .mdb file) from which the data for the PivotTable view was originally retrieved.
RobustConnect | Contains an enumeration indicating what to do when re-establishing a connection if a refresh fails.
RefreshTimeSpan | Specifies how often (in minutes) a PivotTable view or report should be refreshed. A value of zero indicates that timed or automatic refreshing of data is turned off.
LocalConnection | Specifies the text that defines the connection to the local cube slice on the client computer.
NoRefreshCache | Contains a boolean indicating if the cube can be refreshed.
UseLocalConnection | Specifies a Boolean indicating if the user is currently using the local cube slice.
VersionLastEdit | Contains a number indicating what version of Excel last edited the data from the data source.
VersionLastRefresh | Contains a number indicating what version of Excel last refreshed the PivotTable view or query.
VersionRefreshableMin | Contains a number indicating the earliest version of Excel that can refresh the PivotTable view or query table.

### Attributes

None.

## Definition

    <xsd:complexType name="PTQuerySourceType" >
      <xsd:sequence>
        <xsd:element name="QueryType" minOccurs="0">
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="Access" />
              <xsd:enumeration value="ADO" />
              <xsd:enumeration value="ODBC" />
              <xsd:enumeration value="OLEDB" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <xsd:element name="CommandText" type="xsd:string" maxOccurs="unbounded">
        </xsd:element>
        <xsd:element name="CommandType" default="None" minOccurs="0">
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:enumeration value="Cube" />
              <xsd:enumeration value="Default" />
              <xsd:enumeration value="None" />
              <xsd:enumeration value="SQL" />
              <xsd:enumeration value="Table" />
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
        <xsd:element name="Maintain" minOccurs="0">
        </xsd:element>
        <xsd:element name="Connection" type="xsd:string" minOccurs="0">
        </xsd:element>
        <xsd:element name="Parameter" type="ParameterTypeE" minOccurs="0" maxOccurs="unbounded">
        </xsd:element>
        <xsd:element name="CommandTextOrignal" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
        </xsd:element>
        <xsd:element name="SourceConnectionFile" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
        </xsd:element>
        <xsd:element name="SourceDataFile" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
        </xsd:element>
        <xsd:element name="RobustConnect" type="OneZeroType" minOccurs="0">
        </xsd:element>
        <xsd:element name="RefreshTimeSpan" type="xsd:integer" minOccurs="0">
        </xsd:element>
        <xsd:element name="LocalConnection" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
        </xsd:element>
        <xsd:element name="NoRefreshCache" minOccurs="0">
        </xsd:element>
        <xsd:element name="UseLocalConnection" minOccurs="0">
        </xsd:element>
        <xsd:element name="VersionLastEdit" minOccurs="0">
        </xsd:element>
        <xsd:element name="VersionLastRefresh" minOccurs="0">
        </xsd:element>
        <xsd:element name="VersionRefreshableMin" minOccurs="0">
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>

©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