1. Jonathan Meltzer
  2. PowerBuilder
  3. Thursday, 16 May 2019

I have just changed our application to use a DSN-less connection to ODBC, and I am struggling with how to trap an incorrect password condition.  Previously (our current production code), we had an OLE DB connection.  We have a login screen, and if the login fails then we display the error message from SQL Server.  That is fine, but with the new connection, after the error message displays (and the user clicks OK), there is an ODBC login screen that pops up.  I do not want that to happen - I want to display the error message only.

I am not sure where to trap it so that we get the error message but not the ODBC login screen.  Any ideas?

Thanks,

Jonathan 

Accepted Answer
Jonathan Meltzer Accepted Answer Pending Moderation
3
Votes
Undo

Figured this out.  

SQLCA.DBParm = "ConnectString='Driver={ODBC Driver 13 for SQL Server};QuotedId=No;TrustServerCertificate=Yes;Encrypt=Yes;UID="+SQLCA.Logid+";SERVER=" + SQLCA.ServerName + ";Database="+SQLCA.Database+";PWD="+SQLCA.LogPass+"',ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

Comment
Thanks for posting the solution!
  1. Armeen Mazda
  2. Thursday, 16 May 2019
There are no comments made yet.
  1. Thursday, 16 May 2019
  2. PowerBuilder
  3. # Permalink


There are replies in this question but you are not allowed to view the replies from this question.