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 220.127.116.11.3), DBQUERY_WORKSHEET (section 18.104.22.168.5), DBQUERYEXT (section 22.214.171.124.5) and SXADDLDBQUERY (section 126.96.36.199.6), and the DConnrecord (section 2.4.84).