We are moving from Powerbuilder 2017 R3 to Powerbuilder 2019 R2. Of 18 client computers where the updated application has been migrated, 17 have reported no issues, 1 can launch the application but gets error when interacting with the database (SQL Server 2019 15.0.4083.2). The error is "Error loading client library DLLs. Unable to connect to server." Based on our error handling arose after executing "CONNECT Using SQLCA;" which resulted in "SQLCA.SQLCODE = -1" and "SQLCA.SQLDBCode" having value other than -103 (for which we believe the error to be an incorrect SQLCA.LogId or SQLCA.LogPass). As part of a login window, the OK clicked event begins as follows
string s_achUserID, s_achPassword
s_achUserID = sle_userid.text
s_achPassword = Trim(sle_pass.text)
s_achExtra = ""
SQLCA.DBMS = "SNC SQL Native Client(OLE DB)"
SQLCA.LogPass = "sql_server_password"
SQLCA.ServerName = "production_server"
SQLCA.LogId = "sql_server_login"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Database='db_name',AppName='ApplicationName',Host='" + s_achuserid + "',Provider='SQLNCLI11'" // SQL Server 2012 and newer
CONNECT Using SQLCA;
If SQLCA.SQLCODE = -1 Then
If SQLCA.SQLDBCode = -103 Then
MessageBox("Error","Cannot Connect to Database - Invalid UserID or Password.")
MessageBox("Error","Cannot Connect to Database " + SQLCA.SQLERRTEXT)
As seen in attachment, it appears this error is being captured with SQLCA.SQLERRTEXT displayed to user. Rolling the user with issue back to an application build deployed with Powerbuilder 2017 R3 resolves the issue.