handling logon errors

Results 1 to 4 of 4

Thread: handling logon errors

  1. #1
    ASPDoofus Guest

    Default handling logon errors

    I have a site that logs users onto a database by passing the userid and password they input into a form. If there is a problem with the logon (for example-the password doesn&#039t match), I&#039d like to redirect users to an &#039oops.asp&#039 page, but I can&#039t figure out how or where to handle these errors in the following block of code:<BR><BR> set DataConn = Server.CreateObject("ADODB.Connection")<BR> DataConn.Open "DSN=accounting", UserID, UserPwd<BR> set DataCmd = Server.CreateObject ("ADODB.Command")<BR> Set DataCmd.ActiveConnection=DataConn<BR> DataCmd.CommandText = "sp_RetrieveAllAccount" <BR> DataCmd.Execute <BR> Set rs_acctCab = Server.CreateObject ("ADODB.Recordset")<BR> set rs_acctCab = DataCmd.Execute<BR><BR>Any assistance anyone can provide would be greatly appreciated. Thanks.

  2. #2
    12OzCoffeeCup Guest

    Default RE: handling logon errors

    Before you execute the program, you need the script to check the form wiht the database to make sure it&#039s all ok. For example, you may want to check whether or not a username has been taken, or someone type the wrong username/password.<BR><BR>Use an If Then statement to say,<BR><BR>If the pw in the form matches that of the DB<BR> Do this<BR>Else<BR> Response.Redirect "oops.asp" &#039(or whatever extension)

  3. #3
    ASP Doofus Guest

    Default Thanks! One more question

    Thanks for the insight. I&#039m wondering, though, how to handle something like a timeout trying to connect to the database.

  4. #4
    12OzCoffeeCup Guest

    Default RE: Thanks! One more question

    Meaning if it doesn&#039t respond after, say, 15 sec, then show a timeout error?<BR><BR>I don&#039t exactly know the code but i know i&#039ve seen posts about that. Try the search at 4guysfromrolla.com.<BR><BR>Yer bound to find something. Sorry i couldn&#039t help more.

Posting Permissions

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