1. Tim Moulaison
  2. PowerBuilder
  3. Thursday, 2 May 2024 17:25 PM UTC

I was at PowerBuilder Version 2022 Build 1878 when we received the update about that there was a vulnerability when using ADO.NET database connection in a newer update.  I stayed at my current version.  I did not perform a PowerBuilder update until now, when it was said that Build 3356 resolved this issue.  I have performed the updates to get to Build 3356.  Now when I try to connect to the SQL Database, I get the error:

 A connection was successfully established with the server, but then error occurred during the login process. (provider: SSL Provider, error: 0 - The target principal name is incorrect.)

SQLDBCODE= -2146893022

 

Just trying to understand what has changed in this latest PowerBuilder upgrade that now gives me an error when connecting to the SQL Server database.

Attachments (1)
Angie Liu@Appeon Accepted Answer Pending Moderation
  1. Thursday, 9 May 2024 06:10 AM UTC
  2. PowerBuilder
  3. # 1

Hi Tim,

 

We have upgraded the ADO driver in PB2022R2. After the upgrade, the default SSL parameters of the new driver may differ from the old one.

Please try configuring the connection parameter: Trust server certificate=true.

You can test the connection configuration in the Database Painter.

 

If you still encounter issues, we recommend submitting a ticket to expedite the resolution of your problem.

 

Regards,

Angie

Comment
There are no comments made yet.
Tim Moulaison Accepted Answer Pending Moderation
  1. Friday, 24 May 2024 13:19 PM UTC
  2. PowerBuilder
  3. # 2

Hi Angie,

 

That did not resolve my issue.  When I went into PB to test the connection using the Database Painter, I noticed something different.  For the ADO Microsoft ADO.NET option, I was not able to select the Namespace connect information.  I have attached 2 pictures.  One shows the Database Profile Setup from a co-worker who has not performed any of the latest updates for PB 22.  The second shows my options after I performed the latest PB22 updates.

 

Any thoughts?

 

Thank you.

Tim

Attachments (2)
Comment
  1. Angie Liu@Appeon
  2. Monday, 27 May 2024 07:25 AM UTC
Hi Tim,



As your screenshot shows, in the old version, you would select the namespace. After upgrading the ADO driver, there is no longer the concept of a full namespace. You just need to select the SQL Server option, and the program will load the corresponding ADO driver based on your selection.



Regards,

Angie

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 24 May 2024 15:08 PM UTC
  2. PowerBuilder
  3. # 3

Hi Tim;

  If you are referring to Microsoft SQL Server, then I would drop using the ADO.Net client connection altogether.  ADO.net has always been troublesome for any App (never mind PB). Also, you are then dependent the App user's machines to have the correct .NET installation installed as well. A PIA IMHO.

   => MS now recommends (for quite a few years now) to use the newer MSO client to connect with newer SS versions (and higher).  In your PB App that would be ...

SQLCA.DBMS = "MSO"

Food for thought. 

Regards .. Chris

 

Comment
There are no comments made yet.
Tim Moulaison Accepted Answer Pending Moderation
  1. Friday, 24 May 2024 16:57 PM UTC
  2. PowerBuilder
  3. # 4

Hi Chris,

 

Thank you for that information.  I will keep that in mind when we perform our next release.

 

I was wondering if the option to use the ADO.NET Namespace connection was removed from the latest update of PB22?  Just confused why I do not have that option any more.

 

Thank you.

Tim

Comment
  1. Chris Pollach @Appeon
  2. Friday, 24 May 2024 17:16 PM UTC
AFAIK: In beta releases of ADO.NET version 2.0, the System.Data.Sql namespace also contained classes for use with SQL Server common language runtime (CLR) integration. However, those classes have been moved into their own namespace,

Thus, no need to have that setting any longer in the later ADO.Net connectivity.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 24 May 2024 17:05 PM UTC
  2. PowerBuilder
  3. # 5

You should use 'Microsoft OLE DB Driver 19 for SQL Server' which you can download from here:

https://learn.microsoft.com/en-us/sql/connect/oledb/download-oledb-driver-for-sql-server?view=sql-server-ver16

The bitness of the installer refers to the bitness of Windows, not your application. The 64-bit installer will install 32-bit and 64-bit versions of the driver.

Connection info:

sqlca.DBMS = "MSO"
sqlca.LogId = "userid"
sqlca.LogPass = "password"
sqlca.ServerName = "theservername"
sqlca.DBParm = "Provider='MSOLEDBSQL19',Database='thedatabase'"

 

Comment
There are no comments made yet.
Tim Moulaison Accepted Answer Pending Moderation
  1. Monday, 3 June 2024 12:40 PM UTC
  2. PowerBuilder
  3. # 6

I was able to connect to the database through the PB Database and through the application using the connection parameters:

 

What I have noticed is that the driver does not seem to act properly when I choose to connect using SQL Authentication or Windows Authentication.  When I select Windows Authentication, the setting does not seem to be saved when I go back into the properties settings.  When I select SQL Authentication, I enter the SQL User Name and password but when I look at Activity Manager on the SQL DB Server, it shows me connected using my Windows Authentication user name.

Is there an issue with this driver and connecting to the database using SQL Authentication?

Comment
  1. Angie Liu@Appeon
  2. Tuesday, 4 June 2024 01:59 AM UTC
Hi Tim,



Yes, we have also discovered this issue internally and it will be fixed in our subsequent release.



Regards,

Angie

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.