2.2.8 External Connections
A workbook often pulls in data from external data sources (1), such as a database or an OLAPcube. An external connection represents a link between a workbook and a particular external data source (1). It contains properties about the way that the application establishes the connection to the data source (1) and retrieves the data, such as the type of data provider (OLE DB, ODBC, and so on), a server name, security information, and a command to execute on the server. In addition, the external connection contains details about the way the connection is used in the workbook, such as how often to refresh the data.
A data connection object contains external connection information for an external data source (1) that a workbook uses. Data connection objects are independent of the constructs in the workbook that display data, such as tables or PivotTables (section 2.2.5).
A connection definition can be established in an external connection file for easier sharing and reuse, but this overview describes the representation for external data connections that are directly embedded within a workbook file. This embedded representation is required whenever external data is used, and ensures portability of the document and continued operation of the external query in the most cases.
An externalconnection is specified by a combination of the records defined in DBQUERY_WORKBOOK (section 126.96.36.199.3), DBQUERY_WORKSHEET (section 188.8.131.52.5), DBQUERYEXT (section 184.108.40.206.5) and SXADDLDBQUERY (section 220.127.116.11.6), and the DConnrecord (section 2.4.84).