WebQueryConnection class

WebQueryConnection class

Specifies the properties for a web query source. A web query will retrieve data from HTML tables, and can also supply HTTP “Get” parameters to be processed by the web server in generating the HTML by including the parameters and parameter elements.

Inheritance: WebQueryConnectionExternalConnection

The WebQueryConnection type exposes the following members:

Properties

PropertyDescription
idGets the id of the connection.
connection_idSpecifies The unique identifier of this connection.
class_typeGets the type of this ExternalConnection object.
power_query_formulaGets the definition of power query formula.
typeGets or Sets the external connection DataSource type.
source_typeGets or Sets the external connection DataSource type.
sso_idIdentifier for Single Sign On (SSO) used for authentication between an intermediate
spreadsheetML server and the external data source.
save_passwordTrue if the password is to be saved as part of the connection string; otherwise, False.
save_dataTrue if the external data fetched over the connection to populate a table is to be saved
with the workbook; otherwise, false.
refresh_on_loadTrue if this connection should be refreshed when opening the file; otherwise, false.
reconnection_method_typeSpecifies what the spreadsheet application should do when a connection fails.
The default value is ReConnectionMethodType.Required.
reconnection_methodSpecifies what the spreadsheet application should do when a connection fails.
The default value is ReConnectionMethodType.Required.
only_use_connection_fileIndicates whether the spreadsheet application should always and only use the
connection information in the external connection file indicated by the odcFile attribute
when the connection is refreshed. If false, then the spreadsheet application
should follow the procedure indicated by the reconnectionMethod attribute
odc_fileSpecifies the full path to external connection file from which this connection was
created. If a connection fails during an attempt to refresh data, and reconnectionMethod=1,
then the spreadsheet application will try again using information from the external connection file
instead of the connection object embedded within the workbook.
source_fileUsed when the external data source is file-based.
When a connection to such a data source fails, the spreadsheet application attempts to connect directly to this file. May be
expressed in URI or system-specific file path notation.
connection_fileGets the connection file.
is_newTrue if the connection has not been refreshed for the first time; otherwise, false.
This state can happen when the user saves the file before a query has finished returning.
nameSpecifies the name of the connection. Each connection must have a unique name.
keep_aliveTrue when the spreadsheet application should make efforts to keep the connection
open. When false, the application should close the connection after retrieving the
information.
refresh_internalSpecifies the number of minutes between automatic refreshes of the connection.
connection_descriptionSpecifies the user description for this connection
is_deletedIndicates whether the associated workbook connection has been deleted. true if the
connection has been deleted; otherwise, false.
credentials_method_typeSpecifies the authentication method to be used when establishing (or re-establishing) the connection.
credentialsSpecifies the authentication method to be used when establishing (or re-establishing) the connection.
background_refreshIndicates whether the connection can be refreshed in the background (asynchronously).
true if preferred usage of the connection is to refresh asynchronously in the background;
false if preferred usage of the connection is to refresh synchronously in the foreground.
parametersGets ConnectionParameterCollection for an ODBC or web query.
commandThe string containing the database command to pass to the data provider API that will
interact with the external source in order to retrieve data
command_typeSpecifies the OLE DB command type.
1. Query specifies a cube name
2. Query specifies a SQL statement
3. Query specifies a table name
4. Query specifies that default information has been given, and it is up to the provider how to interpret.
5. Query is against a web based List Data Provider.
connection_stringThe connection information string is used to make contact with an OLE DB or ODBC data source.
second_commandSpecifies a second command text string that is persisted when PivotTable server-based
page fields are in use.
For ODBC connections, serverCommand is usually a broader query than command (no
WHERE clause is present in the former). Based on these 2 commands(Command and ServerCommand),
parameter UI can be populated and parameterized queries can be constructed
is_xmltrue if the web query source is XML (versus HTML), otherwise false.
is_xl97This flag exists for backward compatibility with older existing spreadsheet files, and is set
to true if this web query was created in Microsoft Excel 97.
This is an optional attribute that can be ignored.
is_xl2000This flag exists for backward compatibility with older existing spreadsheet files, and is set
to true if this web query was refreshed in a spreadsheet application newer than or equal
to Microsoft Excel 2000.
This is an optional attribute that can be ignored.
urlURL to use to refresh external data.
is_text_datesFlag indicating whether dates should be imported into cells in the worksheet as text rather than dates.
is_xml_source_dataFlag indicating that XML source data should be imported instead of the HTML table itself.
postReturns or sets the string used with the post method of inputting data into a web server
to return data from a web query.
is_parse_preFlag indicating whether data contained within HTML PRE tags in the web page is
parsed into columns when you import the page into a query table.
is_html_tablesFlag indicating whether web queries should only work on HTML tables.
html_formatHow to handle formatting from the HTML source when bringing web query data into the
worksheet. Relevant when sourceData is True.
is_same_settingsFlag indicating whether to parse all tables inside a PRE block with the same width settings
as the first row.
edit_web_pageThe URL of the user-facing web page showing the web query data. This URL is persisted
in the case that sourceData=“true” and url has been redirected to reference an XML file.
Then the user-facing page can be shown in the UI, and the XML data can be retrieved
behind the scenes.
edit_pageThe URL of the user-facing web page showing the web query data. This URL is persisted
in the case that sourceData=“true” and url has been redirected to reference an XML file.
Then the user-facing page can be shown in the UI, and the XML data can be retrieved
behind the scenes.
is_consecutiveFlag indicating whether consecutive delimiters should be treated as just one delimiter.

See Also