2.4.84 DConn

The DConn record specifies information for a single data connection.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

frtHeaderOld

dbt

A

B

C

D

E

F

G

H

I

unused1

cParams

reserved1

J

K

L

M

N

O

P

reserved2

grbitDbt (variable)

...

bVerDbqueryEdit

bVerDbqueryRefreshed

bVerDbqueryRefreshableMin

wRefreshInterval

...

wHtmlFmt

rcc

...

credMethod

reserved3

rgchSourceDataFile (variable)

...

rgchSourceConnectionFile (variable)

...

rgchConnectionName (variable)

...

rgchConnectionDesc (variable)

...

rgchSSOApplicationID (variable)

...

tableNames (variable)

...

params (variable)

...

connection (variable)

...

rgbSQL (variable)

...

rgbSQLSav (variable)

...

rgbEditWebPage (variable)

...

id (variable)

...

frtHeaderOld (4 bytes): An FrtHeaderOld. The frtHeaderOld.rt field MUST be 0x0876.

dbt (2 bytes): A DataSourceType that specifies the type of this data connection.

A - fSavePwd (1 bit): A bit that specifies whether a password is saved for this data connection. This field MUST be ignored if dbt is not equal to 0x0001 or 0x0005.

B - fTablesOnlyHtml (1 bit):  A bit that specifies whether web queries retrieve data from HTML tables only. MUST be ignored if dbt is not equal to 0x0004. MUST be a value from the following table:

Value

Meaning

0x0

Web queries retrieve data from the entire page.

0x1

Web queries retrieve data from HTML tables only.

C - fTableNames (1 bit):  A bit that specifies whether there are any HTML tables saved for this data connection. MUST be ignored if dbt is not equal to 0x0004. Value MUST equal 1 if fTablesOnlyHtml is equal to 1.

D - fDeleted (1 bit):  A bit that specifies whether the data connection associated with the workbook has been deleted.

E - fStandAlone (1 bit):  A bit that specifies whether the data connection is used by the workbook.

F - fAlwaysUseConnectionFile (1 bit):  A bit that specifies whether the data connection information in the connection file is used when the data is refreshed. This field MUST be ignored if dbt is not equal to 0x0001 or 0x0005.

G - fBackgroundQuery (1 bit):  A bit that specifies whether the data connection is refreshed asynchronously.

H - fRefreshOnLoad (1 bit):  A bit that specifies whether the data connection is refreshed after the file is loaded.

I - fSaveData (1 bit):  A bit that specifies if the data for the data connection is persisted in the workbook.

unused1 (7 bits): Undefined and MUST be ignored.

cParams (2 bytes):  An unsigned integer that specifies the number of parameters for a parameterized query. The value MUST equal 0 if fStandAlone equals 0.

reserved1 (2 bytes): MUST be zero and MUST be ignored.

J - fMaintain (1 bit):  A bit that specifies whether the data connection remains open once it is established.

K - fNewQuery (1 bit):  A bit that specifies whether the data connection has been refreshed. MUST be a value from the following table:

Value

Meaning

0

Connection has been refreshed one or more times

1

Connection has not yet been refreshed

L - fImportXmlSource (1 bit):  A bit that specifies whether the underlying XML source or the Web page table has been imported. MUST be ignored if dbt is not equal to 0x0004. MUST be a value from the following table:

Value

Meaning

0

Web page table has been imported

1

XML source has been imported

M - fSPListSrc (1 bit): A bit that specifies whether the query is using a Web-based data provider. MUST be ignored if dbt is not equal to 0x0005.

N - fSPListReinitCache (1 bit):  A bit that specifies whether the Web based data is reinitialized rather than refreshed. MUST be ignored if dbt is not equal to 0x0005. MUST be a value from the following table:

Value

Meaning

0

List is refreshed

1

List is reinitialized by reconnecting to the data provider

O - unused2 (2 bits): Undefined and MUST be ignored.

P - fSrcIsXml (1 bit):  A bit that specifies whether the query source is XML. MUST be ignored if dbt is not equal to 0x0004.

reserved2 (8 bits): MUST be zero and MUST be ignored.

grbitDbt (variable): A ConnGrbitDbt that specifies the query flags.

bVerDbqueryEdit (1 byte):  A DataFunctionalityLevel that specifies the data functionality level the query was last edited with.

bVerDbqueryRefreshed (1 byte):  A DataFunctionalityLevel that specifies the data functionality level the query was last refreshed with.

bVerDbqueryRefreshableMin (1 byte):  A DataFunctionalityLevel that specifies the minimum data functionality level that the application is required to support to refresh the query.

wRefreshInterval (2 bytes): An unsigned integer that specifies the number of minutes to wait between automatic refreshes of the query. The value MUST be greater than or equal 0.

wHtmlFmt (2 bytes): An unsigned integer that specifies the HTML formatting to apply to the imported data for a Web query. MUST be ignored if dbt is not equal to 0x0004. MUST be a value from the following table:

Value

Meaning

0x0001

None

0x0002

Rich text formatting only

0x0003

Full HTML formatting

rcc (4 bytes): An unsigned integer that specifies the reconnection method. MUST be a value from the following table:

Value

Meaning

0x00000000

Reconnection method is determined by the application.

0x00000001

Reconnect. When the data connection is refreshed, the updated connection information is retrieved if it is available. This information is used instead of the persisted connection information.

0x00000002

Never reconnect. Updated connection information is never used even if the information is available and the existing connection information is invalid.

credMethod (1 byte): An unsigned integer that specifies the credentials used during reconnection. MUST be a value from the following table:

Value

Meaning

0x00

Integrated authentication

0x01

Use no credentials

0x02

Use stored credentials

0x03

Prompt for credentials

reserved3 (1 byte): MUST be zero and MUST be ignored.

rgchSourceDataFile (variable): A DConnUnicodeStringSegmented that specifies the database file to use if the existing OLE DB connection fails. MUST be ignored if dbt does not equal 0x0005.

rgchSourceConnectionFile (variable):  A DConnUnicodeStringSegmented that specifies the Office data connection (ODC) file to use if the existing connection fails.

rgchConnectionName (variable):  A DConnUnicodeStringSegmented that specifies the name of the data connection associated with the workbook.

rgchConnectionDesc (variable):  A DConnUnicodeStringSegmented that specifies the description of the data connection associated with the workbook.

rgchSSOApplicationID (variable):  A DConnUnicodeStringSegmented that specifies the single sign-on (SSO) identifier string. MUST be ignored if dbt does not equal 0x0001 or 0x0005.

tableNames (variable):  A DConnUnicodeStringSegmented that specifies the list of table names as a comma-separated list. This field only exists when fTableNames is equal to 1. The total number of characters MUST be less than or equal to 255.

params (variable):  An array of DConnParameter that specifies the parameters of a parameterized query. The size of the array is determined by cParams. MUST NOT exist if fStandAlone is equal to 0.

connection (variable): A variable type field. The data type and meaning vary depending on the value of dbt.

Value of dbt

Meaning

1

connection is a DConnUnicodeStringSegmented that specifies the connection string. If field fStandAlone is 0, then connection.st.cch MUST be 0.

4

connection is a DConnConnectionWeb that specifies the connection information for a Web query.

5

connection is a DConnConnectionOleDb that specifies the connection information for an OLE DB connection string.

6

connection is a TxtQry that specifies information for a text query.

Any other value

connection does not exist.

rgbSQL (variable):  A DConnStringSequence that specifies the database command. For an OLE DB data source, the meaning of the dbost field of ConnGrbitDbtOledb determines the meaning of this field. For an ODBC data source, this string specifies the SQL statement. MUST be ignored if dbt does not equal 0x0001 or 0x0005.

rgbSQLSav (variable):  A DConnStringSequence that specifies the original, non-parameterized SQL statement for an ODBC data source. MUST be ignored if dbt does not equal 0x0001.

rgbEditWebPage (variable):  A DConnStringSequence that specifies the URL for the Web query edit query dialog. MUST be ignored if dbt does not equal 0x0004.

id (variable): A DConnId that specifies the object that this connection is associated with.