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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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