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?