Sir;
I changed dropdown to check boxes. I tried below given code. It works but in a strange manner. In my dummy database I have 9 students. Data gets inserted 9 times but in every row of the SQL table I get nine names of the students separated by a comma in first column,nine entries of PRESENT,ABSENT,LATE etc in the second column separated by commas etc. This repeats nine times consuming 9 rows.The code is shown below.
Thanks for the valued support.
Regards
DAMODAR
===================================
<% dim i%>
<%ses=session("username")
if ses="" then
Response.redirect"redirect/session_over.asp"
end if%>
<BODY>
<%set rs1= conn1.execute ("select count(*) from rollcall")
i = 1
i = i + rs1("")
%>
<%rs2.open("select count(*)from akah_dorm where Gender = 'GIRL'"),conn2%><hr>
<%
Dim objExec, counter
counter=0
for counter = 0 to rs2(0)
response.write("The counter is: "&counter&"<br>")....(This is just for checking.)
If rs2(0) <> "" Then
strSQL = ""
strSQL = strSQL &"INSERT INTO RollCall "
strSQL = strSQL &"(Sr_No,Name_of_Student,Status,Occasion,Date) "
strSQL = strSQL &"VALUES "
strSQL = strSQL &"('"&i&"','"&request.form("stuname")&"','"&request.form("Check")&"','"&request.form("Occasion")&"','"&date()&"')"
Set objExec = Conn.Execute(strSQL)
End IF
next
Response.write("Save completed.")
Conn.Close()
Set objExec = Nothing
Set Conn = Nothing
%>
</BODY>