Scott Mitchell -- Hotmail page style

Results 1 to 2 of 2

Thread: Scott Mitchell -- Hotmail page style

  1. #1
    jenny Guest

    Default Scott Mitchell -- Hotmail page style

    Hi <BR> Scott It did not work<BR>i am sending you my code where i am displaying all the records from and code for where i do delete<BR><BR>Thanks<BR>This is the query where i can display all the record on the screen****<BR> dim StrSql<BR> dim rs<BR> set rs = server.CreateObject ("ADODB.Recordset")<BR> &#039--This query will display Location,Division,LocationId and DivisionId for selected user--<BR> StrSql = "SELECT hr_rep_assignment.user_id, division.division," _<BR> & "location.location,hr_rep_assignment.division_ id, " _ <BR> & "hr_rep_assignment.location_id " _<BR> & "FROM hr_rep_assignment INNER JOIN " _ <BR> & "division ON hr_rep_assignment.division_id = division.division_id INNER JOIN " _<BR> & "location ON hr_rep_assignment.location_id = location.location_id " _<BR> & "WHERE hr_rep_assignment.user_id = &#039" & StrUsername & "&#039 "<BR> rs.open StrSql,conn<BR> <BR> %&#062;<BR> &#060;input type="hidden" name="hidLocID" value="&#060;%=rs("location_id")%&#062;"&#062;&#06 0;/CENTER&#062;&#060;/TD&#062;<BR> &#060;input type="hidden" name="hidDivID" value="&#060;%=rs("division_id")%&#062;"&#062;&#06 0;/CENTER&#062;&#060;/TD&#062; <BR> <BR> &#060;% do while not rs.eof%&#062;<BR> &#060;TR&#062;<BR> &#060;TD ALIGN= "left"&#062;&#060;INPUT TYPE = "checkbox" NAME = "location" VALUE = "checked"&#062;&#060;/TD&#062;<BR> &#060;TD&#062;&#060;CENTER&#062;&#060;%=rs("locati on_id")%&#062;&#060;/CENTER&#062;&#060;/TD&#062;<BR> &#060;TD&#062;&#060;CENTER&#062;&#060;%=rs("Locati on")%&#062;<BR> &#060;TD&#062;&#060;CENTER&#062;&#060;%=rs("Divisi on_id")%&#062;&#060;/CENTER&#062;&#060;/TD&#062;<BR> &#060;TD&#062;&#060;CENTER&#062;&#060;%=rs("Divisi on")%&#062;&#060;/CENTER&#062;&#060;/TD&#062;<BR> &#060;/TR&#062; <BR> &#060;%rs.movenext%&#062;<BR> &#060;%loop%&#062;<BR><BR>This is code where i do delete****<BR>&#060;INPUT TYPE = "submit" VALUE = "Checked Delete" ID = deleteloc NAME = deleteloc&#062;&#060;/CENTER&#062;<BR> <BR> &#060;%&#039*********************************Delet e******************************************** <BR> dim delsql <BR> dim delrs<BR> set delrs = server.CreateObject ("ADODB.Recordset")<BR> locid = Request.Form ("hidLocID")<BR> divid = Request.Form ("hidDivID")<BR> Response.ExpiresAbsolute = now()-1<BR> if request("deleteloc")&#060;&#062;"" then<BR> for each item in Request.Form <BR> if Request.Form("location") = "checked" then<BR> delsql = "delete from hr_rep_assignment " _<BR> & "where user_id = &#039" & userid & "&#039"_<BR> & "and Location_id = &#039" & request("hidlocid") & "&#039"_<BR> & "and division_id = &#039" & request("hiddivid") & "&#039" <BR> <BR> set delrs.Activeconnection = conn<BR> delrs.Open delsql<BR> end if <BR> next<BR> Response.Write delsql<BR> end if<BR> %&#062; <BR> &#060;/FORM&#062;

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Scott Mitchell -- Hotmail page style

    Even if you refresh again, the items are still there? You are listing your items before you are deleting them, so, assume you had items A, B, and C. The first time you visited the page, you&#039d get:<BR><BR>A<BR>B<BR>C<BR><BR>Now, say you wanted to delete B and C, so you check B and C and hit delete. Now you would see:<BR><BR>A<BR>B<BR>C<BR><BR>and then B and C would be deleted. If you were to revisit the page, you&#039d just see:<BR><BR>A<BR><BR>You need to move the Delete stuff BEFORE the display stuff. Hope this helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •