<%@ Language=VBScript %> <% set cn = Server.CreateObject("ADODB.Connection") cn.Open "DSN=Kidsnet_Parent;uid=sa;PWD=sgmkj;APP=ASP Script;DATABASE=Kidsnet" Set rs = Server.CreateObject("ADODB.Recordset") rs.cursorlocation=3 rs.cursortype=3 rs.Open "SELECT kidid,schedule,"& Request("whichday") &" ScheduleDay From Kidonlinetime where Kidid ='"& Request("username")&"'",cn if rs.BOF = true then 'rs.movenext elseif rs.EOF = true then rs.MoveFirst end if str = rs("ScheduleDay") Do While Right(str,1) = "," str = Left(str,Len(str)-1) loop Do While Left(str,1) = "," str = Right(str,Len(str)-1) loop ScheduleArray = Split(str,",") For i=LBound(ScheduleArray) to UBound(ScheduleArray) If StrComp(ScheduleArray(i),Request("TimeSlot"),VBTextCompare) <> 0 then str1 = str1 & ScheduleArray(i)&"," End if Next Do While Right(str1,1) = "," str1 = Left(str1,Len(str1)-1) loop Do While Left(str1,1) = "," str1 = Right(str1,Len(str1)-1) loop if(str1 = "")then str1 = "Always" End if str = "UPDATE KidOnlineTime SET "&Request("whichday")&"='" & str1 &"' Where kidid = '" & request("username")&"'" cn.Execute str rs.close() cn.close() Response.Redirect("ModifySchedule.asp?username="& Request("username")&"&whichday="&Request("whichday")&"&hourallowed="&Request("hourallowed")&"&scheduleTime="&str1) %>