leeny
02-07-2005, 08:52 PM
i have a tacky prob. after doin a loop, im sup to allow the user to check certain columns(those necessary for their search). but how do i know which columns are checked since i did a loop?
here's my codes in case you dun understand
If Request("Submit")="Submit" then
v = request.form("value")
ex = request.form ("exp")
unit = request.form("unit")
sql1 = "Select * from ABS where item = '" &i& "'AND unit = '" &unit& "'"
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
Rs1.open sql1,conn
If Rs1.eof then
Response.write "No records found,please try again!!!"
Else
if ex = "greater or equals to" then
sqlC = "Select Item, Grade, GradeName from ABSSubGrade where Grade >= " &v& " AND ABSID = "&rs1("ABSID")&" "
elseif ex = "Equals to" then
sqlC = "Select Item, Grade, GradeName from ABSSubGrade where Grade = " &v& " AND ABSID = "&rs1("ABSID")&" "
else
sqlC = "Select Item, Grade, GradeName from ABSSubGrade where Grade <= " &v& " AND ABSID = "&rs1("ABSID")&" "
end if
Set RSC = Server.CreateObject("ADODB.RecordSet")
RSC.open sqlC,conn
if ex = "greater or equals to" then
sql3 = "Select Count(*) as ct from ABSSubGrade where Grade >= " &v& " AND ABSID = "&rs1("ABSID")&""
elseif ex = "Equals to" then
sql3 = "Select Count(*) as ct from ABSSubGrade where Grade = " &v& " AND ABSID = "&rs1("ABSID")&""
else
sql3 = "Select Count(*) as ct from ABSSubGrade where Grade <= " &v& " AND ABSID = "&rs1("ABSID")&""
end if
Set RS3 = Server.CreateObject("ADODB.RecordSet")
RS3.open sql3,conn
%>
<br>
<br>
<table width="550" border="1" cellpadding="7" cellspacing="1">
<tr>
<td colspan="2" class="small"><font color="#000000" size="4">Mo<font face="Arial, Helvetica, sans-serif">dified
ABS</font></font><font color="#000066" size="3" face="Arial, Helvetica, sans-serif"><strong>
</strong></font></td>
</tr>
<tr>
<td width="213" class="small"><%=i%></td>
<%
rwset=1
ct=1
Do while not rsc.eof
%>
<td width="300" class="small"><font color="#000000">
<div align="center"> <u><strong><%=RSC("GradeName")%></strong></u>
<input name="option" type="checkbox" id="option" value="checkbox">
</div>
<table width="101" border="1" cellspacing="0" cellpadding="4">
<tr>
<td width="89" height="46"><div align="center"><%=RSC("item")%> </div></td>
</tr>
<tr>
<td width="89" height="56"><div align="center"><%=RSC("Grade")%> </div></td>
</tr>
</table>
<%
f=rwset mod (ct+1)
if(f=0) then
%>
</font> <font color="#000000"> </font> </td>
</tr>
<%
end if
ct=ct+1
rwset=rwset+1
rsc.movenext
loop
end if
%>
</table>
<br>
<br>
<input type="submit" name="Submit2" value="Submit">
please assist me
here's my codes in case you dun understand
If Request("Submit")="Submit" then
v = request.form("value")
ex = request.form ("exp")
unit = request.form("unit")
sql1 = "Select * from ABS where item = '" &i& "'AND unit = '" &unit& "'"
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
Rs1.open sql1,conn
If Rs1.eof then
Response.write "No records found,please try again!!!"
Else
if ex = "greater or equals to" then
sqlC = "Select Item, Grade, GradeName from ABSSubGrade where Grade >= " &v& " AND ABSID = "&rs1("ABSID")&" "
elseif ex = "Equals to" then
sqlC = "Select Item, Grade, GradeName from ABSSubGrade where Grade = " &v& " AND ABSID = "&rs1("ABSID")&" "
else
sqlC = "Select Item, Grade, GradeName from ABSSubGrade where Grade <= " &v& " AND ABSID = "&rs1("ABSID")&" "
end if
Set RSC = Server.CreateObject("ADODB.RecordSet")
RSC.open sqlC,conn
if ex = "greater or equals to" then
sql3 = "Select Count(*) as ct from ABSSubGrade where Grade >= " &v& " AND ABSID = "&rs1("ABSID")&""
elseif ex = "Equals to" then
sql3 = "Select Count(*) as ct from ABSSubGrade where Grade = " &v& " AND ABSID = "&rs1("ABSID")&""
else
sql3 = "Select Count(*) as ct from ABSSubGrade where Grade <= " &v& " AND ABSID = "&rs1("ABSID")&""
end if
Set RS3 = Server.CreateObject("ADODB.RecordSet")
RS3.open sql3,conn
%>
<br>
<br>
<table width="550" border="1" cellpadding="7" cellspacing="1">
<tr>
<td colspan="2" class="small"><font color="#000000" size="4">Mo<font face="Arial, Helvetica, sans-serif">dified
ABS</font></font><font color="#000066" size="3" face="Arial, Helvetica, sans-serif"><strong>
</strong></font></td>
</tr>
<tr>
<td width="213" class="small"><%=i%></td>
<%
rwset=1
ct=1
Do while not rsc.eof
%>
<td width="300" class="small"><font color="#000000">
<div align="center"> <u><strong><%=RSC("GradeName")%></strong></u>
<input name="option" type="checkbox" id="option" value="checkbox">
</div>
<table width="101" border="1" cellspacing="0" cellpadding="4">
<tr>
<td width="89" height="46"><div align="center"><%=RSC("item")%> </div></td>
</tr>
<tr>
<td width="89" height="56"><div align="center"><%=RSC("Grade")%> </div></td>
</tr>
</table>
<%
f=rwset mod (ct+1)
if(f=0) then
%>
</font> <font color="#000000"> </font> </td>
</tr>
<%
end if
ct=ct+1
rwset=rwset+1
rsc.movenext
loop
end if
%>
</table>
<br>
<br>
<input type="submit" name="Submit2" value="Submit">
please assist me