I have a Form called "StaffList.asp" and another one is call "Entitlement.asp".
Stafflist.asp have this input value (as password field).
<TD ALIGN=CENTER><INPUT TYPE=PASSWORD NAME="Enrolment">
Entitlement.asp supposed to carry out SQL search based on the input value from "enrolment" field;
Below SQL statement does not work
==================================
rsView.Open "Select * From [Staff_Module] WHERE StaffEnrolNr= '"&Enrolment&"'", DB
==================================
However, the SQL statement runs Only if I quote StaffEnrolment number, for example "DJ1122", as in below:
====================================
rsView.Open "Select * From [Staff_Module] WHERE StaffEnrolNr= 'DJ1122'", DB
====================================
Here is the original code.....
<%
Dim DB, rsView , sql, Enrolment
Enrolment = Request.form("Enrolment")
'Enrolment = Request("Enrolment")
set DB=Server.CreateObject("ADODB.Connection")
set rsView=Server.CreateObject("ADODB.Recordset")
DB.Open "Personnel"
rsView.Open "Select * From [StaffEnrolList] WHERE StaffEnrolNr= '"&Enrolment&"'", DB
%>
Dan
Stafflist.asp have this input value (as password field).
<TD ALIGN=CENTER><INPUT TYPE=PASSWORD NAME="Enrolment">
Entitlement.asp supposed to carry out SQL search based on the input value from "enrolment" field;
Below SQL statement does not work
==================================
rsView.Open "Select * From [Staff_Module] WHERE StaffEnrolNr= '"&Enrolment&"'", DB
==================================
However, the SQL statement runs Only if I quote StaffEnrolment number, for example "DJ1122", as in below:
====================================
rsView.Open "Select * From [Staff_Module] WHERE StaffEnrolNr= 'DJ1122'", DB
====================================
Here is the original code.....
<%
Dim DB, rsView , sql, Enrolment
Enrolment = Request.form("Enrolment")
'Enrolment = Request("Enrolment")
set DB=Server.CreateObject("ADODB.Connection")
set rsView=Server.CreateObject("ADODB.Recordset")
DB.Open "Personnel"
rsView.Open "Select * From [StaffEnrolList] WHERE StaffEnrolNr= '"&Enrolment&"'", DB
%>
Dan