Exception occurred. --- Why?

Results 1 to 3 of 3

Thread: Exception occurred. --- Why?

  1. #1
    Join Date
    Dec 1969
    Posts
    9

    Default Exception occurred. --- Why?

    Can someone give ma clue as to why this is not working, I must sleep soon....<BR><BR>IF request.form ("ActivateAccount")="Active" THEN<BR> IF Request.form ("Alias")="" THEN<BR> response.write ("<BR><BR><BR>&#060;p align=center CLASS=emailcell&#062;")<BR> Response.Write ("You have not entered your Username yet!&#060;/p&#062;")<BR> ELSE<BR> IF request.form ("FirstPass")="" THEN<BR> response.write ("<BR><BR><BR>&#060;p align=center CLASS=emailcell&#062;You will need to add a password<BR>Please return to the previous page and add a password please.&#060;/p&#062;")<BR> ELSE<BR> strRemPass=request.form("RememberPass")<BR> strAccAlias=request.form("Alias")<BR> strAccPass=request.form("FirstPass")<BR> strAccStatus=request.form("ActivateAccount")<BR> strProvider="DRIVER=Microsoft Access Driver (*.mdb); DBQ=" & Server.MapPath("dbase") & "ecash.mdb;"<BR> strPassSQL = "SELECT * FROM Accounts WHERE AccountPassword = &#039strAccPass&#039 ORDER BY UserIDNumber"<BR> strLoginSQL = "SELECT * FROM Contacts WHERE Alias = &#039strAccAlias&#039 AND AccountPassword = &#039strAccPass&#039"<BR> <BR> Set rsContacts = Server.CreateObject("ADODB.recordset")<BR> rsContacts.Open strLoginSQL, strProvider<BR> <BR> IF rsContacts("UserIDNumber") &#060;&#062; "" THEN<BR> session("SessUserID") = objAliasCheckID<BR> response.write ("<BR><BR><BR>&#060;p align=center CLASS=emailcell&#062;")<BR> response.write ("Your Login was successful!<BR>")<BR> response.redirect("./accountdetails.asp")<BR> ELSE<BR> Response.Write ("<BR><BR><BR>&#060;p align=center CLASS=emailcell&#062;")<BR> Response.write ("Your Login was unsuccessful,please return and try again or apply<BR> for an account if you do not have one.")<BR> END IF<BR> END IF<BR> END IF<BR>ELSE%&#062;<BR><BR>The error I get is :<BR><BR>error &#039 80020009&#039 <BR>Exception occurred. <BR><BR>/dologin.asp, line 35 <BR><BR>referring to the : IF rsContacts("UserIDNumber") &#060;&#062; "" THEN<BR>line as far as i can tell.<BR>Thanks heaps anyone<BR><BR>Bryce Christensen<BR>thegrott@hotmail.com<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    27

    Default RE: Exception occurred. --- Why?

    Just a guess but try taking the two speechmarks out.."" and leave &#060;&#062;

  3. #3
    TM Guest

    Default RE: Exception occurred. --- Why?

    Just a guess, maybe you are not detecting an EOF. Your sql statement does not seem to pass the _variables_ strAccPass and strAccAlias but the actual strings. Thus an empty recordset is being returned?<BR><BR><BR>strLoginSQL = "SELECT * FROM Contacts WHERE Alias = &#039strAccAlias&#039 AND AccountPassword = &#039strAccPass&#039"<BR><BR>// Shouldnt this be <BR>// strLoginSQL = "SELECT * FROM Contacts WHERE Alias = &#039" & strAccAlias & "&#039 AND AccountPassword = &#039" & strAccPass & "&#039"<BR><BR>Set rsContacts = Server.CreateObject("ADODB.recordset")<BR>rsContac ts.Open strLoginSQL, strProvider<BR><BR>// You should always check for EOF, If not rsContacts.EOF then<BR>IF rsContacts("UserIDNumber") &#060;&#062; "" THEN<BR>session("SessUserID") = objAliasCheckID<BR><BR><BR><BR>

Posting Permissions

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