Configuring ODBC data source with SQL Server demo database

Before setting up the ODBC data source with the SQL Server demo database, install and configure SQL Server properly.

Using a local SQL Server

Installing SQL Server

SQL Server 2016, 2017, and 2019 are supported. You can follow the steps to install SQL Server. Please pay attention to the required items when installing it.

Step 1: Install SQL Server.

  1. Select "New SQL Server stand-alone installation or add features to an existing installation".


  2. Click Next until the Feature Selection page displays. In this page, select these two features: Database Engine Services and Client Tools Connectivity.


  3. Click Next until the Database Engine Configuration page displays. In this page, the authentication mode is set as Windows authentication mode by default. Click Add Current User to add the current Windows user as the SQL Server administrator.


  4. Click Next until the SQL Server installation completes.

Step 2: Install SQL Server Management Studio.

  1. Select "Install SQL Server Management Tools" and then follow the instructions to complete the installation.


  2. After the installation, open SQL Server Management Studio and log in.


Enabling TCP/IP

Open SQL Server Configuration Manager and enable the TCP/IP protocol. The TCP/IP protocol is disabled by default.


(Optional) Installing the OLEDB driver

If you select to install the SQL Server version of the PowerBuilder demo database, a connection with the demo database on the local computer will be created using the OLEDB driver. OLEDB version 18 and 19 are supported now.

You can install the proper version before installing the product, or PowerBuilder Installer will automatically install version 19 (if neither OLEDB 18 nor 19 has been installed).

Using a remote SQL Server

Restoring database

If the SQL Server version of the PowerBuilder demo database has been installed, while there is no SQL Server installed in the local environment, you can use an existing SQL Server in a remote server.

Step 1 -- Copy the database file to the remote server. The database file can be found in this location after installation: C:\Users\Public\Documents\Appeon\PowerBuilder 22.0\pbsqlserver2022.bak.

Step 2 -- In SQL Server Management Studio, right-click on Database and select New Database to create a new database.

Step 3 -- Right-click on Database and select Restore Database.


Step 4 -- Select the pbsqlserver2022.bak file (copied in step 1) as the source database, and select the database (created in step 2) as the destination database.



Step 5 -- Click OK to restore the database.

Modifying the demo application scripts

After you restore the database file in a remote server, you will now need to modify the demo application to connect with the demo database on the remote server.

For example, you can modify the demo application to connect with the demo database on the remote server via the following connection strings.

SQLCA.DBMS = "MSOLEDBSQL SQL Server"

SQLCA.LogPass = 'admin'

SQLCA.ServerName = "172.16.1.102"

SQLCA.LogId = "sa"

SQLCA.AutoCommit = False

SQLCA.DBParm = "Database='PBDemoDB2022', Provider='MSOLEDBSQL19', DelimitIdentifier=1"

To modify Example Demo:

Replace the following scripts in the Open event of the application object


With the following scripts:


To modify Sales Demo:

Replace the following scripts in the Open event of the application object


With the following scripts:


To modify Graph Demo:

Replace the following scripts in the Open event of the application object


With the following scripts: