I've created a login form to try to bypass the sql server login screen. The code below works great if the user types in their username and password correctly. If they make an error, the error message appears and the actual sql server login screen appears. I want to check for the error and not allow the sql server login screen to appear but set focus back to my form. I have the user type in a username and password and press OK button which contains the code below. I've connected to a table because I don't know how to make an actual connection to sql server. This is my quick and dirty was of connecting to sql server. Any advice/help would be appreciated.