Setting up the database server

Preparations

In this tutorial, we will set up the salesdemo SQL Anywhere database server running in an independent machine.

Set up the database server with the following OS and software:

  • Windows Server 2019 (64-bit)

  • SQL Anywhere 17

    Click here to download the installer for the free trial of SQL Anywhere developer edition.

    This tutorial takes SQL Anywhere database as an example. You can also install the other databases by following the documentation from the vendor.

    Note that the SQL Anywhere database can only be connected through an ODBC driver. You will need to create the same ODBC data source in both the development PC and the .NET server. The data source in the development PC is for converting DataWindows to models, and the data source in the .NET server is for accessing data from the database. The following sections have detailed instructions for how to create the ODBC data source.

Note

For optimal runtime performance, it is highly recommended that the PowerServer Web APIs should be published to a server that locates on the same LAN as the database server. If the database is not on the same network as the Web APIs, every request has to go a long way from PowerServer to the database, it is highly possible that there will be performance and security issues.

Configuring Windows Defender Firewall

If Windows Defender Firewall or any antivirus tool is turned on, make sure to configure them to allow the database server port (2638 in this tutorial or the port number you choose to use) to go through, otherwise, connection errors may occur.

You would need to configure the firewall/antivirus settings on the following servers:

  • Database server -- to allow the database server port (2638 in this tutorial)

  • .NET server -- to allow the .NET server port (5009 in this tutorial)

  • Web server -- to allow the FTP server port (21 in this tutorial) (this only affects the FTP connection during the app deployment)

The following steps configure the firewall settings on the database server (you can take the same steps to configure the other servers):

Step 1: Open Windows Defender Firewall and then click Advanced settings.

Step 2: Select Inbound Rules and then click New Rule.


Step 3: Create a new rule which allows connections through the database server port (2638 in this tutorial).


Starting the database

Step 1: Download the database file (pbdemo2022_for_sqlanywhere.zip) from https://github.com/Appeon/PowerBuilder-Project-Example-Database.

Or copy the database file (pbdemo2022.db) from the PowerBuilder demo installation folder (%Public%\Documents\Appeon\PowerBuilder 22.0\) to the database server, if PowerBuilder IDE is installed.

Step 2: Start this database file on the salesdemo database server using SQL Anywhere Network Server (dbsrv17.exe).

The database server must be started as a network server (not a personal server) in order to support network connections.

"C:\Program Files\SQL Anywhere 17\Bin64\dbsrv17.exe" -x tcpip(port=2638) -n salesdemo "C:\DB\pbdemo2022.db"