aspose.cells

Class DBConnection

Specifies all properties associated with an ODBC or OLE DB external data connection.

Property Getters/Setters Summary
functiongetBackgroundRefresh()
function
           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.
functiongetCommand()
function
setCommand(value)
           The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data
functiongetCommandType()
function
           Specifies 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. The value of the property is OLEDBCommandType integer constant.
functiongetConnectionDescription()
function
           Specifies the user description for this connection
functiongetConnectionId()
Specifies The unique identifier of this connection.
functiongetConnectionInfo()
function
           The connection information string is used to make contact with an OLE DB or ODBC data source.
functiongetCredentials()
function
           Specifies the authentication method to be used when establishing (or re-establishing) the connection. The value of the property is CredentialsMethodType integer constant.
functiongetCredentialsMethodType()
function
           Specifies the authentication method to be used when establishing (or re-establishing) the connection. The value of the property is CredentialsMethodType integer constant.
functiongetId()
Gets the id of the connection.
functionisDeleted()
function
setDeleted(value)
           Indicates whether the associated workbook connection has been deleted. true if the connection has been deleted; otherwise, false.
functionisNew()
function
setNew(value)
           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.
functiongetKeepAlive()
function
           True when the spreadsheet application should make efforts to keep the connection open. When false, the application should close the connection after retrieving the information.
functiongetName()
function
setName(value)
           Specifies the name of the connection. Each connection must have a unique name.
functiongetOdcFile()
function
setOdcFile(value)
           Specifies 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.
functiongetOnlyUseConnectionFile()
function
           Indicates 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
functiongetParameters()
Gets ConnectionParameterCollection for an ODBC or web query.
functiongetPowerQueryFormula()
Gets the definition of power query formula.
functiongetReconnectionMethod()
function
           Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required. The value of the property is ReConnectionMethodType integer constant.
functiongetReconnectionMethodType()
function
           Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required. The value of the property is ReConnectionMethodType integer constant.
functiongetRefreshInternal()
function
           Specifies the number of minutes between automatic refreshes of the connection.
functiongetRefreshOnLoad()
function
           True if this connection should be refreshed when opening the file; otherwise, false.
functiongetSaveData()
function
           True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.
functiongetSavePassword()
function
           True if the password is to be saved as part of the connection string; otherwise, False.
functiongetSeverCommand()
function
           Specifies 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
functiongetSourceFile()
function
           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 be expressed in URI or system-specific file path notation.
functiongetSSOId()
function
setSSOId(value)
           Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.
functiongetType()
Gets or Sets the external connection DataSource type.
 

    • Property Getters/Setters Detail

      • getConnectionInfo/setConnectionInfo : String 

        function getConnectionInfo() / function setConnectionInfo(value)
        
        The connection information string is used to make contact with an OLE DB or ODBC data source.
      • getPowerQueryFormula : PowerQueryFormula 

        function getPowerQueryFormula()
        
        Gets the definition of power query formula.
      • getCommandType/setCommandType : Number 

        function getCommandType() / function setCommandType(value)
        
        Specifies 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. The value of the property is OLEDBCommandType integer constant.
      • getCommand/setCommand : String 

        function getCommand() / function setCommand(value)
        
        The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data
      • getSeverCommand/setSeverCommand : String 

        function getSeverCommand() / function setSeverCommand(value)
        
        Specifies 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
      • getId : Number 

        function getId()
        
        Gets the id of the connection.
      • getType : ConnectionDataSourceType 

        function getType()
        
        Gets or Sets the external connection DataSource type.
      • getSourceFile/setSourceFile : String 

        function getSourceFile() / function setSourceFile(value)
        
        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 be expressed in URI or system-specific file path notation.
      • getSSOId/setSSOId : String 

        function getSSOId() / function setSSOId(value)
        
        Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.
      • getSavePassword/setSavePassword : boolean 

        function getSavePassword() / function setSavePassword(value)
        
        True if the password is to be saved as part of the connection string; otherwise, False.
      • getSaveData/setSaveData : boolean 

        function getSaveData() / function setSaveData(value)
        
        True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.
      • getRefreshOnLoad/setRefreshOnLoad : boolean 

        function getRefreshOnLoad() / function setRefreshOnLoad(value)
        
        True if this connection should be refreshed when opening the file; otherwise, false.
      • getReconnectionMethodType/setReconnectionMethodType : Number 

        function getReconnectionMethodType() / function setReconnectionMethodType(value)
        
        Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required. The value of the property is ReConnectionMethodType integer constant.
      • getReconnectionMethod/setReconnectionMethod : Number 

        function getReconnectionMethod() / function setReconnectionMethod(value)
        
        Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required. The value of the property is ReConnectionMethodType integer constant. NOTE: This property is now obsolete. Instead, please use ExternalConnection.ReconnectionMethodType property. This property will be removed 12 months later since October 2017. Aspose apologizes for any inconvenience you may have experienced.
      • getOnlyUseConnectionFile/setOnlyUseConnectionFile : boolean 

        function getOnlyUseConnectionFile() / function setOnlyUseConnectionFile(value)
        
        Indicates 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
      • getOdcFile/setOdcFile : String 

        function getOdcFile() / function setOdcFile(value)
        
        Specifies 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.
      • isNew/setNew : boolean 

        function isNew() / function setNew(value)
        
        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/setName : String 

        function getName() / function setName(value)
        
        Specifies the name of the connection. Each connection must have a unique name.
      • getKeepAlive/setKeepAlive : boolean 

        function getKeepAlive() / function setKeepAlive(value)
        
        True when the spreadsheet application should make efforts to keep the connection open. When false, the application should close the connection after retrieving the information.
      • getRefreshInternal/setRefreshInternal : Number 

        function getRefreshInternal() / function setRefreshInternal(value)
        
        Specifies the number of minutes between automatic refreshes of the connection.
      • getConnectionId : Number 

        function getConnectionId()
        
        Specifies The unique identifier of this connection.
      • getConnectionDescription/setConnectionDescription : String 

        function getConnectionDescription() / function setConnectionDescription(value)
        
        Specifies the user description for this connection
      • isDeleted/setDeleted : boolean 

        function isDeleted() / function setDeleted(value)
        
        Indicates whether the associated workbook connection has been deleted. true if the connection has been deleted; otherwise, false.
      • getCredentialsMethodType/setCredentialsMethodType : Number 

        function getCredentialsMethodType() / function setCredentialsMethodType(value)
        
        Specifies the authentication method to be used when establishing (or re-establishing) the connection. The value of the property is CredentialsMethodType integer constant.
      • getCredentials/setCredentials : Number 

        function getCredentials() / function setCredentials(value)
        
        Specifies the authentication method to be used when establishing (or re-establishing) the connection. The value of the property is CredentialsMethodType integer constant. NOTE: This property is now obsolete. Instead, please use ExternalConnection.CredentialsMethodType property. This property will be removed 12 months later since October 2017. Aspose apologizes for any inconvenience you may have experienced.
      • getBackgroundRefresh/setBackgroundRefresh : boolean 

        function getBackgroundRefresh() / function setBackgroundRefresh(value)
        
        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.