BlogDatabases & integration

PowerBuilder and SQL Server: Replacing SQL Native Client with MSOLEDBSQL

SQL Server Native Client went out of support in 2022 and no longer ships with SQL Server. The replacement is PowerBuilder's MSOLEDBSQL interface, and version 19 of Microsoft's driver encrypts by default. Here are the settings that change, the two failures to expect, and the documented fix for each.

Published 14 October 20266 min read

SQL Server Native Client 11Endedsupport ended 12 July 2022; not shipped with SQL Server 2022
MSOLEDBSQL 19 encryptionMandatorydriver default since 19.0.0; PowerBuilder's Encrypt DBParm defaults to 0
Latest driver19.4.3released 9 October 2026
2011Native Client deprecatedannounced by Microsoft
2018MSOLEDBSQL 18the new OLE DB driver
15 Feb 2022MSOLEDBSQL 19encrypted by default
12 Jul 2022Native Client 11support ends
9 Oct 2026MSOLEDBSQL 19.4.3latest release
SQL Server 2022 and SSMS 19 no longer ship SQL Server Native Client.

Why SNC has to go

Microsoft calls SQL Server 2012's Native Client 11 “the last available version”. Its support policy lists connections to SQL Server 2008 through 2014 and Azure SQL Database, and says the remaining lifecycle exception does not cover “using SQL Native Client 11.0 as a driver for database applications”.

Appeon's documentation still lists the SNC interface for SQL Server 2016 to 2025, so the two vendors' documents do not match. On the Appeon Community, Appeon's Armeen Mazda backs the move: “You should use the new native client replacement as John said, and also it is what Microsoft recommends.”

What changes

SettingSNC todayMSOLEDBSQL 19
DBMSSNC SQL Native ClientMSOLEDBSQL SQL Server
ProviderProvider='SQLNCLI11'; without one PowerBuilder selects SQLNCLI, the SQL Server 2005 clientProvider='MSOLEDBSQL19', from PowerBuilder 2022; without it, version 18
Driver on each PCSQL Server Native Clientmsoledbsql.msi 19.x and the Visual C++ Redistributable (x86 and x64 for the x64 package)
PowerBuilder DLLpbsnc.dllpbmsoledbsql.dll

In PowerScript:

SQLCA.DBMS       = "MSOLEDBSQL SQL Server"
SQLCA.ServerName = "sql01.example.com"
SQLCA.DBParm     = "Provider='MSOLEDBSQL19',Database='sales',Encrypt=1"

Appeon's connection guide notes that version 19 syntax also works with the version 18 driver when version 19 is not installed, so a PC without version 19 runs version 18 without any error: check the driver version on each client. The two versions install side by side, and the x64 msoledbsql.msi also installs the 32-bit driver. Appeon's Runtime Packager does not include it: distribute the MSI yourself, with IACCEPTMSOLEDBSQLLICENSETERMS=YES for a silent install.

Failure 1: the certificate chain error

The connection can now fail with:

SSL Provider: The certificate chain was issued by an authority
that is not trusted.

Version 19 turns encryption on by default (Encrypt is Mandatory) and validates the server's certificate (TrustServerCertificate is no), so a server certificate the client does not trust fails the check. Microsoft's troubleshooting article gives the fixes in this order:

FixIn PowerBuilderMicrosoft says
1. A trusted certificateInstall a server certificate the clients trustRecommended
2. Trust the certificateEncrypt=1,TrustServerCertificate=1, and registry Flag2 set to 1“Use it only as a temporary measure”
3. Optional encryptionDriver keyword Encrypt=Optional; the Encrypt DBParm documents only 0, 1 and 2Restores version 18 behaviour and reduces security
4. Stay on 18.xLeave out the Provider, keep driver 18Only “as a temporary measure”

Three PowerBuilder details decide whether a fix takes effect:

  • The TrustServerCertificate DBParm is ignored unless Encrypt=1.
  • The registry wins. If Flag2 under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SNI19.0\GeneralFlags is 0, the driver validates the certificate whatever the DBParm says: it “chooses the most secure option between the registry and the connection property/keyword settings”. Appeon's fix is to set Flag2 to 1 or provide a verifiable certificate; installers before 19.4.1 could copy a 0 over from version 18.
  • Appeon documents Encrypt=0 as the DBParm default, for driver 19.x too, with “No encryption occurs”, while the driver's own default is Mandatory. Neither vendor says what PowerBuilder passes to the driver when the DBParm is 0, so set Encrypt explicitly and test it.

Encrypt=2 selects Strict encryption (TDS 8.0), which needs SQL Server 2022 or later; the driver then always validates the certificate and ignores TrustServerCertificate. For TLS 1.3, Appeon lists driver 19.2.0 or later and SQL Server 2022 build 16.0.4025.1 or later.

Failure 2: updates on tables with triggers

An update on a table whose trigger changes other tables can fail with “Row changed between retrieve and update”. With a trigger, the number of affected rows that reaches PowerBuilder “depends on the driver”, Appeon says. Its troubleshooting guide lists the problem for the ADO.NET, OLE DB and SNC interfaces, and a 2025 R2 user on the Appeon Community hit it after moving to MSOLEDBSQL 19.

Two fixes:

  • In the trigger: SET NOCOUNT ON. Microsoft's guide to updating OLE DB applications says a statement that fires a trigger while NOCOUNT is off can return different results and an error: “To resolve this error, set NOCOUNT ON in the trigger.”
  • In PowerBuilder: RecheckRows=1. Appeon's troubleshooting guide says it “solves the problem”. It runs SELECT @@ROWCOUNT after each change, so Appeon advises setting it only when required and resetting it to 0 afterwards.

Check after the switch

AreaWhat to check
BindingAppeon's DisableBind default list names SNC (1) but not MSOLEDBSQL, so set DisableBind explicitly to the value you ran with. With binding on, inserts send NULL instead of letting column defaults apply, and Identity='SCOPE_IDENTITY()' can return NULL.
Dates and timesPowerBuilder 2025 R2 handles datetime2 with up to 7 fractional seconds, and PSR files exported from earlier versions change their fractional seconds; datetimeoffset is not supported. Retest datetime updates.
Always EncryptedNot supported by the OLE DB driver. Microsoft's ODBC driver supports it; neither vendor documents it through a PowerBuilder interface, so test before relying on it.
Windows and serversDriver 19.4.2 and later do not support Windows 10. SQL Server 2012 support ended with 19.3.3, and 2014 with 19.3.5.

The order of work

  1. List the applications on SNC, their SQL Server versions and the Windows versions of their clients.
  2. Install driver 19.x with the Visual C++ Redistributable on one test client, and check the registry flags.
  3. Change the DBMS and the Provider, and set Encrypt and DisableBind explicitly.
  4. Fix the server certificate, or agree an end date for any temporary trust setting.
  5. Test updates on every table with triggers, then inserts with defaults or identity columns, then datetime updates.
  6. Roll the driver out with your own installer, then switch the applications.

Moving a large application? We do this as fixed-scope work for one defined problem: the switch, the trigger, binding and date checks, and a written list of what changed.

Frequently asked

Is SQL Server Native Client supported with SQL Server 2022?

Not by Microsoft. SQL Server Native Client 11 is the last version, its support ended on 12 July 2022, and it does not ship with SQL Server 2022 or SSMS 19. Microsoft documents it for servers up to SQL Server 2014. Appeon's documentation still lists the SNC interface for SQL Server 2016 to 2025, but Appeon staff recommend moving to the MSOLEDBSQL interface.

What Provider value does PowerBuilder need for MSOLEDBSQL 19?

Provider='MSOLEDBSQL19' in the DBParm, with the DBMS set to "MSOLEDBSQL SQL Server"; Appeon supports it from PowerBuilder 2022. Without a Provider, PowerBuilder uses version 18, which registers as MSOLEDBSQL. Versions 18 and 19 of the driver can be installed side by side.

How do I fix "The certificate chain was issued by an authority that is not trusted"?

Microsoft's order: install a server certificate the clients trust (recommended); trust the certificate only as a temporary measure; set encryption to Optional, which restores version 18 behaviour and lowers security; or stay on driver 18.x for now. In PowerBuilder, TrustServerCertificate is ignored unless the Encrypt DBParm is 1, and a registry Flag2 of 0 overrides it: Appeon's fix is to set Flag2 to 1 or provide a verifiable certificate.

Does the PowerBuilder Runtime Packager install the Microsoft OLE DB Driver?

No. Appeon's Runtime Packager does not add other ODBC or OLE DB files an application needs. Distribute Microsoft's msoledbsql.msi yourself; from version 19.3 it needs the Visual C++ Redistributable, and a silent install needs IACCEPTMSOLEDBSQLLICENSETERMS=YES.

Does MSOLEDBSQL support Always Encrypted?

No. Microsoft's driver feature matrix lists Always Encrypted as not supported in the OLE DB driver, while its ODBC and JDBC drivers support it. Neither Microsoft nor Appeon documents Always Encrypted through a PowerBuilder database interface, so test the ODBC route before committing to it.

PowerBuilder notes, now and then

New writing on upgrades, databases and modernization — a few times a month, nothing more.