1. Jonathan Meltzer
  2. PowerBuilder
  3. Thursday, 16 May 2019 19:22 PM UTC

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
  1. Thursday, 16 May 2019 20:03 PM UTC
  2. PowerBuilder
  3. # Permalink

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
  1. Armeen Mazda @Appeon
  2. Thursday, 16 May 2019 21:30 PM UTC
Thanks for posting the solution!
  1. Helpful
There are no comments made yet.


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