Connection XML

Looking at the XML in the workbook connections part that describes the connection whose id="2":

<connection id="2" odcFile="
  c:\…\externalData.odc" keepAlive="1" name="externalData"
  description="FoodMart 2000 - Budget Planing" type="5"
  refreshedVersion="3" background="1">
  <dbPr connection="Provider=MSOLAP.2;Integrated Security=SSPI;Persist
    Security Info=True;Data Source=xlextdat8;Initial
      Catalog=AdamTest;Client
    Cache Size=25;Auto Synch Period=10000;MDX Compatibility=1"
      command="Budget" commandType="1"/>
  <olapPr sendLocale="1" rowDrillCount="1000"/>
</connection>

Attributes on the <connection> element express properties about the connection.

  • @odcFile indicates the location of the data connection file which was used to create this connection. Data connection files can be created on the local machine, on any network share, or any web location whenever the connection is created so that the connection information can be reused if desired. The connection information is copied from the connection file into the spreadsheet. When a connection cannot be established, the spreadsheet application can check the external connection file to see if a newer definition of the connection is available.

  • @name indicates the friendly name of the connection. This name must be unique within a workbook.

  • @keepAlive indicates that the application should hold the connection open once established, instead of closing the connection after retrieving the data.

  • @type value of 5 indicates that this connection type is OLEDB.

  • @refreshedVersion indicates the version of the application which last refreshed this connection.

  • @background value of 1 indicates that background refresh (asynchronous refresh) is enabled. Note that this is not a guarantee that the connection will be refreshed asynchronously. Certain objects may require a connection to be refreshed either synchronously or asynchronously regardless of this setting.

Attributes on the <dbPr> element express additional properties on the connection.

  • @connection expresses the connection string that is needed to establish a connection to the external data source.

  • @command can indicate a table name, a cube name, or an SQL expression requesting data.

  • @commandType indicates what kind of information is found in @command: 1 means the value of @command is the name of an OLAP cube.

Attributes on the <olapPr> element express properties that apply to connections to OLAP data sources.

  • @sendLocale value of 1 indicates that the client application should send its user interface language locale to the OLAP data provider in order to receive back from the server localized OLAP cube member string values.

  • @rowDrillCount is number of rows to return on a drill through request.