DBConnection Class
Contents
[
Hide
]DBConnection class
Specifies all properties associated with an ODBC or OLE DB external data connection.
type DBConnection struct {
ptr unsafe.Pointer
}
Constructors
Method | Description |
---|---|
NewDBConnection | Constructs from a parent object. |
Methods
Method | Description |
---|---|
IsNull | Checks whether the implementation object is nullptr. |
GetClassType | Gets the type of this |
GetConnectionString | The connection information string is used to make contact with an OLE DB or ODBC data source. |
SetConnectionString | The connection information string is used to make contact with an OLE DB or ODBC data source. |
GetPowerQueryFormula | Gets the definition of power query formula. |
GetCommandType | Specifies the OLE DB command type.1. Query specifies a cube name2. Query specifies a SQL statement3. Query specifies a table name4. 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. |
SetCommandType | Specifies the OLE DB command type.1. Query specifies a cube name2. Query specifies a SQL statement3. Query specifies a table name4. 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. |
GetCommand | The string containing the database command to pass to the data provider API that willinteract with the external source in order to retrieve data |
SetCommand | The string containing the database command to pass to the data provider API that willinteract with the external source in order to retrieve data |
GetSecondCommand | Specifies a second command text string that is persisted when PivotTable server-basedpage fields are in use.For ODBC connections, serverCommand is usually a broader query than command (noWHERE 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 |
SetSecondCommand | Specifies a second command text string that is persisted when PivotTable server-basedpage fields are in use.For ODBC connections, serverCommand is usually a broader query than command (noWHERE 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 |
GetId | Gets the id of the connection. |
GetSourceType | Gets or Sets the external connection DataSource type. |
SetSourceType | Gets or Sets the external connection DataSource type. |
GetSSOId | Identifier for Single Sign On (SSO) used for authentication between an intermediatespreadsheetML server and the external data source. |
SetSSOId | Identifier for Single Sign On (SSO) used for authentication between an intermediatespreadsheetML server and the external data source. |
GetSavePassword | True if the password is to be saved as part of the connection string; otherwise, False. |
SetSavePassword | True if the password is to be saved as part of the connection string; otherwise, False. |
GetSaveData | True if the external data fetched over the connection to populate a table is to be savedwith the workbook; otherwise, false. |
SetSaveData | True if the external data fetched over the connection to populate a table is to be savedwith the workbook; otherwise, false. |
GetRefreshOnLoad | True if this connection should be refreshed when opening the file; otherwise, false. |
SetRefreshOnLoad | True if this connection should be refreshed when opening the file; otherwise, false. |
GetReconnectionMethodType | Specifies what the spreadsheet application should do when a connection fails.The default value is ReConnectionMethodType.Required. |
SetReconnectionMethodType | Specifies what the spreadsheet application should do when a connection fails.The default value is ReConnectionMethodType.Required. |
GetOnlyUseConnectionFile | Indicates whether the spreadsheet application should always and only use theconnection information in the external connection file indicated by the odcFile attributewhen the connection is refreshed. If false, then the spreadsheet applicationshould follow the procedure indicated by the reconnectionMethod attribute |
SetOnlyUseConnectionFile | Indicates whether the spreadsheet application should always and only use theconnection information in the external connection file indicated by the odcFile attributewhen the connection is refreshed. If false, then the spreadsheet applicationshould follow the procedure indicated by the reconnectionMethod attribute |
GetOdcFile | Specifies the full path to external connection file from which this connection wascreated. 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 fileinstead of the connection object embedded within the workbook. |
SetOdcFile | Specifies the full path to external connection file from which this connection wascreated. 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 fileinstead of the connection object embedded within the workbook. |
GetSourceFile | Used 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 beexpressed in URI or system-specific file path notation. |
SetSourceFile | Used 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 beexpressed in URI or system-specific file path notation. |
IsNew | True 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. |
SetIsNew | True 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. |
GetName | Specifies the name of the connection. Each connection must have a unique name. |
SetName | Specifies the name of the connection. Each connection must have a unique name. |
GetKeepAlive | True when the spreadsheet application should make efforts to keep the connectionopen. When false, the application should close the connection after retrieving theinformation. |
SetKeepAlive | True when the spreadsheet application should make efforts to keep the connectionopen. When false, the application should close the connection after retrieving theinformation. |
GetRefreshInternal | Specifies the number of minutes between automatic refreshes of the connection. |
SetRefreshInternal | Specifies the number of minutes between automatic refreshes of the connection. |
GetConnectionDescription | Specifies the user description for this connection |
SetConnectionDescription | Specifies the user description for this connection |
IsDeleted | Indicates whether the associated workbook connection has been deleted. true if theconnection has been deleted; otherwise, false. |
SetIsDeleted | Indicates whether the associated workbook connection has been deleted. true if theconnection has been deleted; otherwise, false. |
GetCredentialsMethodType | Specifies the authentication method to be used when establishing (or re-establishing) the connection. |
SetCredentialsMethodType | Specifies the authentication method to be used when establishing (or re-establishing) the connection. |
GetBackgroundRefresh | Indicates 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. |
SetBackgroundRefresh | Indicates 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. |
GetParameters | Gets |
GetConnectionFile | Gets the connection file. |