다음을 통해 공유


Rollback (MDStore Interface)

[!참고]

  이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.

The Rollback method of the MDStore interface rolls back a transaction on a database. All changes made to the object subsequent to the initiation of the transaction with the BeginTrans method are voided and the object remains in the state it was in at the time of the beginning of the transaction.

Applies To:clsDatabase

구문

object.Rollback    

매개 변수

  • object
    The database object on which to roll back the transaction.

주의

If the Rollback method is called without first calling the BeginTrans method, an error occurs.

The following code example begins a transaction on the FoodMart 2000 database, processes the Sales and Budget cubes, and rolls back the transaction. Executing the Rollback method for the database restores the Sales and Budget cubes to the state prior to the execution of the BeginTrans method.

    Dim dsoServer As New DSO.Server
    Dim dsoDB As DSO.MDStore
    Dim dsoCube As DSO.MDStore

    ' Connect to the local Analysis server.
    dsoServer.Connect "LocalHost"
    
    ' Open the FoodMart 2000 database.
    Set dsoDB = dsoServer.MDStores("FoodMart 2000")
    
    ' Begin a transaction on the database.
    dsoDB.BeginTrans
    
    ' Create a reference to the Sales cube.
    Set dsoCube = dsoDB.MDStores("Sales")
    
    ' Process the cube, refreshing data.
    dsoCube.Process processRefreshData
    
    'Create a reference to the Budget cube.
    Set dsoCube = dsoDB.MDStores("Budget")
    
    ' Process the cube completely.
    dsoCube.Process processFull
    
    ' Rollback the transaction
    dsoDB.Rollback