BookmarkSubscribeRSS Feed
amueller11
Calcite | Level 5

Hi there,

we have a bunch of Excel/VBA-programs to do our reporting.

Our data we select from a SQL-DB.

Now we changed our DB to SAS.

I'm now trying to connect to SAS to use the reporting as it is, but the connection doesn't work.

I use the following code to build up a connection to SAS.

    Dim obObjectFactory As New SASObjectManager.ObjectFactory

    Dim obServer As New SASObjectManager.ServerDef

    Dim sasWS As sas.Workspace

   

    obServer.MachineDNSName = "lcub1sa"

    obServer.Protocol = SASObjectManager.Protocols.ProtocolBridge

    obServer.Port = 18561

   

    Set sasWS = obObjectFactory.CreateObjectByServer("My_Prod_Data", True, obServer, "myusername", "mypassword")

When running this code i get an 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."

Any ideas to avoid this exception and to set up a valid connection are wellcome.

Regard

Achim Müller

2 REPLIES 2
PhilC
Rhodochrosite | Level 12

@CaseySmith 

 

I'm looking to answer this question.  My Google skills are weak.  Is there a good search term you'd recommend?

CaseySmith
SAS Employee

Hey @PhilC,

 

I searched, "sas integration technologies client documentation", which led me here:
https://support.sas.com/rnd/itech/doc9/dev_guide/index.html

...then to here:
https://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/winclnt/index.html
...and to some code samples:
https://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/winclnt/omsamples.html

 

In the example above, the error is (as it says) a result of attempting to connect to a metadata server (usually port 8561) instead of a workspace server.  If you change the port to the workspace server port (usually 8591), it should work.

 

Casey

 

ps- Sorry for the delayed response, I've fallen behind on Communities lately due to another project.

 


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Discussion stats
  • 2 replies
  • 2664 views
  • 0 likes
  • 3 in conversation