clsCubeAnalyzer

ms132796.note(zh-cn,SQL.90).gif注意:
  下一版本的 Microsoft SQL Server 将删除该功能。请不要在新的开发工作中使用该功能,并尽快修改当前还在使用该功能的应用程序。

A Decision Support Objects (DSO) object of ClassType clsCubeAnalyzer contains a single method used to extract information from the query log. The query log stores the descriptions of queries executed on the Analysis server. This object provides a method through its own internal interface.

There are no collections or properties associated with an object of ClassType clsCubeAnalyzer.

Examples

Retrieving the Cube Query Log

The following code example retrieves the entire contents of a cube's query log from the Analysis server and prints the number of records in the immediate window:

Option Explicit

Public dsoServer As DSO.Server
Public dsoDB As DSO.MDStore
Public dsoCube As DSO.MDStore
Public dsoCubeAnalyzer As DSO.CubeAnalyzer
Public ADODBRecSet As ADODB.Recordset

Public Sub AnalyzeCube()
    If dsoServer Is Nothing Then
       Set dsoServer = New DSO.Server
         'MyServer is the name of the Analysis server.
         dsoServer.Connect ("MyServer")
    End If
    
    'Get first database from server.
    Set dsoDB = dsoServer.MDStores(1)
    
    'Get first cube from database.
    Set dsoCube = dsoDB.MDStores(1)
    
    'Get analyzer object from cube.
    Set dsoCubeAnalyzer = dsoCube.Analyzer
    
    'Get recordset from log.
    Set ADODBRecSet = dsoCubeAnalyzer.OpenQueryLogRecordset _
      ("SELECT * FROM QueryLog")
      
    If ADODBRecSet.BOF And ADODBRecSet.EOF Then
        Debug.Print "<<No records in query log>>"
    Else
        ADODBRecSet.MoveLast
       Debug.Print "   Record count: " & ADODBRecSet.RecordCount
    End If
End Sub
 

请参阅

参考

Methods, clsCubeAnalyzer

帮助和信息

获取 SQL Server 2005 帮助