5

我正在尝试使用 Excel VBA 连接到工作区服务器。使用此页面上的信息,我制作了以下内容:

Dim obSAS As SAS.Workspace
Dim obWorkspaceManager As New SASWorkspaceManager.WorkspaceManager
Private Sub Form_Load()
   Dim obConnection As New ADODB.Connection
   Dim obRecordSet As New ADODB.Recordset
   Dim obServerDef As New SASWorkspaceManager.ServerDef
   Dim xmlString As String
   obServerDef.Port = 28561
   obServerDef.Protocol = ProtocolBridge 
   obServerDef.MachineDNSName = "blah.server.com"
   Set obSAS = obWorkspaceManager.Workspaces.CreateWorkspaceByServer( "Ref", _
      VisibilityProcess, obServerDef, "me@saspw","MyPass", xmlStr)
end sub

我的第一反应是这样的:

<xml id="combridgeOutput"><connectionAttempts><connectionAttempt>
  <sasserver></sasserver>
  <sasmachinednsname>blah.server.com</sasmachinednsname>
  <sasport>28561</sasport>
  <saslogin>me@saspw</saslogin>
  <status>0x80041001</status>
  <description><Exceptions><Exception>
  <SASMessage severity="Error">
    The client has connected to a SAS (9.2) Metadata Server (v1.0) when 
    it intended to connect to a SAS Workspace Server.
  </SASMessage>
  </Exception></Exceptions></description>
</connectionAttempt></connectionAttempts></xml>

所以我更新了端口号以指向工作区服务器,现在我得到了这个:

  <same XML tags as above >
  <SASMessage severity="Error">
    Client me@saspw does not have permission to use server 
    SASMeta - Workspace Server (A5DPDN69.AV000069).
  </SASMessage>

宁愿不为此练习设置特殊权限。还有什么办法可以将 VBA 连接到 SAS 工作区服务器会话?

4

1 回答 1

3

嗬!我使用了错误的机器名称。作为参考,这里是获取正确机器名称的过程!

  1. 登录 SMC
  2. 展开服务器管理器
  3. 展开 SASApp
  4. 展开 SASApp - 逻辑工作区服务器

在那里您将看到正确的机器,并且还会显示端口详细信息..

于 2012-11-26T19:07:47.850 回答