Results 1 to 2 of 2

Thread: Help!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    Canton, GA
    Posts
    487

    Help!!

    Ok I keep getting a 500 server error... I am new at ASP so someone please tell me what I may be doing wrong here..

    Code for my login script... Just FYI - Yes we have a secure certificate, and yes my DB is fine - I have other pages that read from it...


    PLEASE HELP!

    <%@ Language=VBScript %>

    <%
    UserName = Request.Form("user_name")
    Password = Request.Form("password")

    Dim conn

    Set conn = Server.CreateObject("ADODB.Connection")

    conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _

    Server.MapPath("\data\data.mdb"))

    Dim strSQL, rs

    strSQL = "Select User_ID, User_Password From tblUsers " _
    & "Where UserName = '"&User_ID&"' And Password = '"&User_Password&"'"

    If Not RS.EOF Then
    Session("allow") = True

    Response.Redirect "https://www.mysite.net/technical_services/admin/"

    Else
    Response.Redirect "https://www.mysite.net/technical_services/"

    rs.Close

    Set rs = Nothing

    conn.Close

    Set conn = Nothing

    %>

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366
    Your If..Then needs an End If.

    And the line with conn.Open(...) will probably need Call before it; so: Call conn.Open(...)

    And rs is never assigned anything in the code you posted. so: Set rs = conn.Execute(strSQL)

    And in the line:
    VB Code:
    1. strSQL = "Select User_ID, User_Password From tblUsers " _
    2. & "Where UserName = '"&User_ID&"' And Password = '"&User_Password&"'"
    User_ID and User_Password are not mentioned anywhere so they will always evaluate to an empty string in that line of code.

Posting Permissions

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



Click Here to Expand Forum to Full Width