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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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