# QuerySource element (PTSourceType complexType)

Describes the data source that the PivotTable view is based on when the PivotTable view is created from an external source.

## Usage

    <QuerySource />

## Element Information

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

## Elements and Attributes

### Parent Elements

Element | Description
--- | ---
PTSource | Contains information describing the data source of the PivotTable view.

### 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:element name="QuerySource" type="PTQuerySourceType" minOccurs="0" >
    </xsd:element>

©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