1. Neil N
  2. PowerBuilder
  3. Wednesday, 21 February 2024 03:01 AM UTC

Upgrading a PB 12.5  app to PB 2022R3. Uses ADO.NET to connect to SQL Server. App crashes during connection process (i.e., after credentials are entered and Login button is clicked) on a Windows 11 machine.

Faulting application name: xxx.exe, version: 1.0.0.1, time stamp: 0x658d10a2
Faulting module name: xxx.exe, version: 1.0.0.1, time stamp: 0x658d10a2
Exception code: 0xc0000409
Fault offset: 0x00012a82
Faulting process id: 0x0x15E4
Faulting application start time: 0x0x1DA646FD992D0EB
Faulting application path: C:\Apps\xxx\xxx.exe
Faulting module path: C:\Apps\xxx\xxx.exe
Report Id: 77bd4b8b-d3a9-4160-9755-5339e7ca10f8
Faulting package full name:
Faulting package-relative application ID:

Used PowerBuilder Runtime Packager 2022 R3 to deploy supporting files and installed latest version of .NET 6 Desktop runtime. Lots of reboots.

If I install the full PB IDE, the app runs fine. Any help?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2024 18:45 PM UTC
  2. PowerBuilder
  3. # 1

Hi Neil;

  FYI ...

  • You might want to stop using ADO.Net as per the Microsoft bulletin: https://www.cve.org/CVERecord?id=CVE-2024-0056
  • Note that Microsoft SQL Server connectivity going forward is via the newer MSOLEDBSQL DB Client.
    • SQLCA.DBMS = "MSO"

Regards .. Chris

 

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Thursday, 22 February 2024 07:48 AM UTC
  2. PowerBuilder
  3. # 2

Hi Neil,

Since your PB IDE is running properly, I suggest you try it like this:

If there are any PB runtime files(*.dll) in the directory where your EXE/PBL resides, please delete them and then try again.
Secondly, I suggest you use PB Installer to install PowerBuilder Runtime on the Client and try again and see if it works properly. For how to install PowerBuilder Runtime you can refer to: https://docs.appeon.com/pb2022/application_techniques/PowerBuilder_runtime_files.html#Installing_PowerBuilder_Runtime
 
 
Regards,
Ken

Comment
  1. Neil N
  2. Thursday, 22 February 2024 13:32 PM UTC
Hi Ken,



1) There are no PB runtime files in the app directory.

2) How is your suggestion different from what I posted initially: "Used PowerBuilder Runtime Packager 2022 R3 to deploy supporting files"?
  1. Helpful
  1. Ken Guo @Appeon
  2. Friday, 23 February 2024 09:25 AM UTC
Hi Neil,



The PowerBuilder Runtime Packager only packages runtime files, including either 32-bit or 64-bit DLLs, and it does not write registry information. Exe programs cannot directly use it.

On the other hand, the PowerBuilder Runtime installed via PB Installer is the default runtime used by PB. It includes both 32-bit and 64-bit DLLs. After installation, it not only writes registry information but also installs to a fixed location, and exe programs to directly use it.



Regards,

Ken
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Thursday, 22 February 2024 15:39 PM UTC
  2. PowerBuilder
  3. # 3

I agree with Chris.  Change your DBMS in your transaction object!

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 22 February 2024 15:48 PM UTC
Hopefully Kevin, you meant the DB Client used - not the whole DBMS - LOL!
  1. Helpful
  1. Kevin Ridley
  2. Thursday, 22 February 2024 16:05 PM UTC
Yes! That's why I said in the transaction object. Definitely didn't mean to change the whole database, just the interface!
  1. Helpful
There are no comments made yet.
Neil N Accepted Answer Pending Moderation
  1. Thursday, 22 February 2024 16:24 PM UTC
  2. PowerBuilder
  3. # 4

Hi Chris,

I expect by the time we go into production, Appeon will have provided a service release, incorporating the patched sqlclient.dll.  However I'm working on the switch to see if it fixes the crash but I'm getting an immediate "login failed" error.  I know the app isn't sending the creds, as it should be timing out after a delay when it can't reach the server because the VPN isn't connected (also tested with VPN connected).  Works fine in IDE and as an executable where IDE is installed.

Code fragment:

ElseIf is_dbms = "MSOLEDBSQL" Then
    sqlca.Logid = as_userid
    sqlca.Logpass = as_password
    ls_dsn = ProfileString(of_GetAppIniFile(), "Application", "DSN", "")
    ls_datasource = ProfileString(of_GetAppIniFile(), "Application", "Datasource", "")
    ls_commandtimeout = ProfileString(of_GetAppIniFile(), "Application", "CommandTimeout", "")
    SQLCA.DBMS = "MSOLEDBSQL SQL Server"
    SQLCA.ServerName =ls_datasource
    SQLCA.AutoCommit = False
    SQLCA.DBParm = "Database='" + ls_dsn + "',DelimitIdentifier=1,NCharBind=0"    
End If

ini file

[Application]
dbms=MSOLEDBSQL
DSN=Members
Datasource=10.150.150.175
CommandTimeout=6000

Comment
  1. Neil N
  2. Thursday, 22 February 2024 16:55 PM UTC
Am I using the same client as you? In the PB IDE I choose MSOLEDBSQL SQL Server in Database Profiles (32-bit). This gives me a Preview of:



// Profile DB_BETA

SQLCA.DBMS = "MSOLEDBSQL SQL Server"

SQLCA.LogPass = <*********>

SQLCA.ServerName = "10.150.150.175"

SQLCA.LogId = "xxx"

SQLCA.AutoCommit = False

SQLCA.DBParm = "Database='MEMBERS',DelimitIdentifier=1,NCharBind=0"

  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 22 February 2024 17:00 PM UTC
So these parameters work OK when running your PB App(s) from the IDE or its. EXE on your DEV machine?
  1. Helpful
  1. Neil N
  2. Thursday, 22 February 2024 17:07 PM UTC
Yes, correct. Run from IDE - fine.



On dev machine I created a temp directory which only contains exe, pbds, and ini file. Works fine
  1. Helpful
There are no comments made yet.
Neil N Accepted Answer Pending Moderation
  1. Thursday, 22 February 2024 17:27 PM UTC
  2. PowerBuilder
  3. # 5

So, kind of weird. I compiled the app as 32-bit and deployed the 32-bit PowerBuilder components.  This config resulted in the crash I noted in the OP.  When I re-compiled as 64-bit and deployed the 64-bit components, it worked.  I'm going to try this on a fresh Windows 11 VM to make sure this is the actual solution.

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 22 February 2024 17:44 PM UTC
Hi Neil;

Ahhh ... That explains it! When you install the MSO DB client you can select the 32 bit, 64 bit or both bitnesess. So it seems like you only have the 64 bit SS DB client installed. HTH

Regards ... Chris
  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.