B
bender
I'm having a bit of problem with a login script
<%
Dim sql
Dim len
Dim username, password
username = request.form("username")
password = request.form("pass")
sql = "Select * from Users where User_ID = '" & username & "' AND password =
'" & password & "';"
set adoCon = server.CreateObject ("adodb.connection")
adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
Server.MapPath("something.mdb") & ";Persist Security Info=False"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, adoCon
len = rs.recordcount
response.write len
%>
This outputs -1 regardless if I enter the correct username\password or not.
Wondering if my sql sentence is correct, not sure about the " and ' is
correct. Both User_ID and password are text fields in the database
<%
Dim sql
Dim len
Dim username, password
username = request.form("username")
password = request.form("pass")
sql = "Select * from Users where User_ID = '" & username & "' AND password =
'" & password & "';"
set adoCon = server.CreateObject ("adodb.connection")
adoCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
Server.MapPath("something.mdb") & ";Persist Security Info=False"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, adoCon
len = rs.recordcount
response.write len
%>
This outputs -1 regardless if I enter the correct username\password or not.
Wondering if my sql sentence is correct, not sure about the " and ' is
correct. Both User_ID and password are text fields in the database