Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009

    Question Unanswered: How to trap SQL Login Error

    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.


    Set db = CurrentDb()

    Set tbl = db.TableDefs("sql table name")

    tbl.Connect = "ODBC;DSN="name";Server="name";Database="name";UID =" & Me!UserName & ";pwd=" & Me!Password & ""


  2. #2
    Join Date
    Jul 2004
    South Dakota
    I have the same situation...hopefully someone out there knows how to do it.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts