Ready to get started?

Download a free trial of the SQL Analysis Services ODBC Driver to get started:

 Download Now

Learn more:

SQL Server Analysis Services Icon SQL Analysis Services ODBC Driver

The SQL Analysis Services ODBC Driver is a powerful tool that allows you to connect with live data from SQL Analysis Services, directly from any applications that support ODBC connectivity.

Access Analysis Services report data like you would a database, through a standard ODBC Driver interface. Supports Direct Query and MDX query capabilities.

Connect to SQL Analysis Services Data from PowerBuilder



This article demonstrates how to use the CData ODBC Driver for SQL Analysis Services to connect to SQL Analysis Services data and execute queries in PowerBuilder.

The CData ODBC Driver for SQL Analysis Services can be used from any platform or development technology that supports ODBC, including PowerBuilder. This article shows how to connect to SQL Analysis Services data and execute queries from the Database Painter and controls such as the DataWindow.

Connect to SQL Analysis Services as an ODBC Data Source

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.

To connect, provide authentication and set the Url property to a valid SQL Server Analysis Services endpoint. You can connect to SQL Server Analysis Services instances hosted over HTTP with XMLA access. See the Microsoft documentation to configure HTTP access to SQL Server Analysis Services.

To secure connections and authenticate, set the corresponding connection properties, below. The data provider supports the major authentication schemes, including HTTP and Windows, as well as SSL/TLS.

  • HTTP Authentication

    Set AuthScheme to "Basic" or "Digest" and set User and Password. Specify other authentication values in CustomHeaders.

  • Windows (NTLM)

    Set the Windows User and Password and set AuthScheme to "NTLM".

  • Kerberos and Kerberos Delegation

    To authenticate with Kerberos, set AuthScheme to NEGOTIATE. To use Kerberos delegation, set AuthScheme to KERBEROSDELEGATION. If needed, provide the User, Password, and KerberosSPN. By default, the data provider attempts to communicate with the SPN at the specified Url.

  • SSL/TLS:

    By default, the data provider attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store. To specify another certificate, see the SSLServerCert property for the available formats.

You can then access any cube as a relational table: When you connect the data provider retrieves SSAS metadata and dynamically updates the table schemas. Instead of retrieving metadata every connection, you can set the CacheLocation property to automatically cache to a simple file-based store.

See the Getting Started section of the CData documentation, under Retrieving Analysis Services Data, to execute SQL-92 queries to the cubes.

Create a Profile for the ODBC Driver for SQL Analysis Services

Follow the steps below to use the Database Painter tool to create a database profile based on an ODBC DSN (data source name) for SQL Analysis Services. In the Database Painter, you can use wizards and the UI to work with SQL Analysis Services data.

  1. In PowerBuilder, click Tools -> Database Painter.
  2. In the Objects window in the Database Painter, right-click the ODBC node and click New Profile.
  3. On the Connection tab, enter a name for the profile and select the SQL Analysis Services DSN in the Data Source menu.
  4. To view and modify a table, right-click a table and then click Edit Data -> Grid.

Using SQL Analysis Services Data with PowerBuilder Controls

You can use standard PowerBuilder objects to connect to ODBC data sources and execute queries. The following example shows how to retrieve SQL Analysis Services data into a DataWindow. You can add the following code to the open method:

SQLCA.DBMS = "ODBC" SQLCA.DBParm = "ConnectString='DSN=CData SSAS Source'" CONNECT USING SQLCA; dw_adventure_works.SetTransObject(SQLCA); dw_adventure_works.Retrieve();