与Essbase的ADOMD连接

时间:2018-09-12 07:27:44

标签: vb.net adomd.net essbase

以下代码用于打开与Essbase的连接。

添加了AdomdClient和MSAdomdClientSCLib作为参考

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Dim Obj As New AdomdConnection

    Try
        Obj.ConnectionString = "Data Source =http://address/aps/XMLA; Catalog=RPT_ARC; User Id=XXX; Password=YYY; Provider=ESSBASE"

        Obj.Open()
        TextBox1.Text = "Connection State: " + Obj.State.ToString
        TextBox1.Text += Environment.NewLine + "Database : " + Obj.Database.ToString
        TextBox1.Text += Environment.NewLine + "Connection Timeout : " + Obj.ConnectionTimeout.ToString
        TextBox1.Text += Environment.NewLine + "Session ID: " + Obj.SessionID.ToString
        TextBox1.Text += Environment.NewLine + "Server Version: " + Obj.ServerVersion.ToString
        TextBox1.Text += Environment.NewLine + "Provider Version: " + Obj.ProviderVersion.ToString
        TextBox1.Text += Environment.NewLine + "Client Version: " + Obj.ClientVersion.ToString

    Catch ex As AdomdConnectionException
        TextBox1.Text = "Exception:" + ex.ToString
        Throw ex
    Finally

    End Try

End Sub

当我检查连接状态时,它说“打开”。奇怪的是,Obj.Database.ToString不包含任何值?

如果我添加其他代码段来计算多维数据集的数量

TextBox1.Text += Environment.NewLine + "# of cubes: " + Obj.Cubes.Count.ToString

我收到以下例外情况

Exception thrown: 'Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException' in Microsoft.AnalysisServices.AdomdClient.dll ("")

我有三个问题

1)尽管连接状态为打开状态,为什么Obj.Database.ToString不包含任何值?

2)为什么我要计算多维数据集数时会引发异常?

3)用户ID和用户名是否相同?

0 个答案:

没有答案