In this recipe, you learn how to connect to a remote SAS OLAP Server by using the OLAP Data Provider.
| Applies to: | SAS OLAP Data Provider |
| Implement using: | ADO |
To connect to a remote SAS OLAP Server, you specify the remote server information and then then you use the Connection object's Open method to establish a connection. The following Visual Basic code illustrates these steps:
' Constants defined in SASWorkspaceManager Type Library.
const ProtocolCom = 0
const ProtocolCorba = 1
const ProtocolBridge = 2
Dim obConnection As ADODB.Connection
Set obConnection = New ADODB.Connection
obConnection.Provider = "sas.OLAPProvider.9.1"
' Indicates a SAS OLAP Server
obConnection.Properties("Data Source") = "lambchop.unx.sas.com"
obConnection.Properties("SAS Port") = 1359
obConnection.Properties("SAS Protocol") = ProtocolBridge
obConnection.Properties("User ID") = "fred"
obConnection.Properties("Password") = "banana"
obConnection.Open
Note: For information about how to establish a local connection to a SAS OLAP Server, see Reading Multidimensional Data with ADO MD. For more information about how to open a Connection object, see Opening an ADO Connection Object.
The following table lists all relevant Connection object properties.
| Property | Value | Required for a remote server? |
|---|---|---|
| Data Source | The name of the OLAP server. | Yes |
| User ID | User ID to authenticate against the server. | Might be required by server. |
| Password | Password to use with the user ID in authenticating against the server. | Might be required by server. |
| SAS Port | TCP/IP port number of the remote server. | Must specify either this property or the "SAS Service Name" property. |
| SAS Service Name | Logical reference to the port associated with a remote server. | Yes, unless "SAS Port" is specified. |
| SAS Protocol | IOM protocol to use when connecting to the remote server. | Yes |