I keep getting errors and I know it's probably something basic that I am overlooking.
I am passing a variable from a form. I have tested the variable and it works.
This code is intended to check for a code in the database that matches the request form variable.
If not isempty(request.form("code"))then
'test for code
response.write RS("code")
Set MyConn = Server.CreateObject("ADODB.Connection")
set RS = Server.CreateObject("ADODB.Recordset")
MyConn.Open ("DSN=school")
SQL_Query=("SELECT * FROM log WHERE code = " & request.form("code"))
Set RS = MyConn.Execute(SQL_Query)
Do Until RS.EOF
RS("code")
rs.MOVENEXT
loop
else
response.write("Sorry your code does not match a known record")
end if
If anyone knows what I am missing, pleae let me know. Thanks
I am passing a variable from a form. I have tested the variable and it works.
This code is intended to check for a code in the database that matches the request form variable.
If not isempty(request.form("code"))then
'test for code
response.write RS("code")
Set MyConn = Server.CreateObject("ADODB.Connection")
set RS = Server.CreateObject("ADODB.Recordset")
MyConn.Open ("DSN=school")
SQL_Query=("SELECT * FROM log WHERE code = " & request.form("code"))
Set RS = MyConn.Execute(SQL_Query)
Do Until RS.EOF
RS("code")
rs.MOVENEXT
loop
else
response.write("Sorry your code does not match a known record")
end if
If anyone knows what I am missing, pleae let me know. Thanks