Stupid problem drived me crazy! Help me!!!

Results 1 to 2 of 2

Thread: Stupid problem drived me crazy! Help me!!!

  1. #1
    SkyRider Guest

    Default Stupid problem drived me crazy! Help me!!!

    Hi, <BR>it&#039s very queer that seemingly correct codes don&#039t bring the correct results. what&#039s the problem? pls help me!!!<BR>Following codes written in JScript have the problem???<BR>///////////////////////////////////////////////////////////////<BR>conn.Open(DBPATH);<BR>var sql = "select * from staffs where name = &#039"+Request.Form("user_name")+"&#039";<BR>va r rs = conn.Execute(sql);<BR>var s1 = Request.Form("user_pswd").Item;<BR>var s2 = rs("password").value;<BR> <BR>if ( s1 == s2) {<BR> Response.Write("&#060;h1&#062;You are welcome!&#060;/h1&#062;<BR>");<BR>} else {<BR> Response.Write("Access Denied!");<BR>}<BR><BR>/*<BR>Why whenever I input the correct password the result is always <BR>"Access Denied" which means that<BR> s1 != s2<BR> even when I input the correct password.<BR>*/<BR>///////////////////////////////////////////////////////////////

  2. #2
    SkyRider Guest

    Default Solved!

    Finally I found out that it&#039s not the problem of JScipt but of the database. Coz I set the field "password" with Char(8) fixed datatype. So if I input a 8-less didit password into the database. it will come up such a problem. So I immediately change the field data type to varchar(8) and it works! :)<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