Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: updating in list


Message #1 by "Scott Echols" <scott.echols@r...> on Fri, 21 Sep 2001 17:52:21
I have a problem updating checkboxes.  On my page, I have a list of 

records returned that the user is supposed to review, and enter a serial 

number for each record and click a checkbox for each record if a certain 

criteria applies.  I don't know how to go about doing it. Here is the 

code.  Thanks.



<%@ Language=VBScript %>

<% Response.buffer=true %>

<%





Nav=Session("Nav")

criteria=Session("criteria")

selection=Session("selection")

PDselect=Session("PD")

NSNselect=Session("NSN")

strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath

("scrub.mdb")

set conn = server.createobject("adodb.connection") 

set rs3= server.createobject("adodb.recordset") 

conn.open strconn



if Session("PD")="ALC" then

	strsql="Select * from scrubbed_data where "& selection &" ='" & 

criteria & "';"

elseif Session("PD")<>"ALC" then

	strsql="Select * from scrubbed_data where "& selection &" ='" & 

criteria & "' and div ='" & PDselect & "' and scrub_usp_if_coal>0 ;"

end if



rs3.open strsql, conn, 2, 2

If Request("action")="Logout" then

	Session.abandon

	Response.redirect "https://wwwmil.robins.af.mil/logistics/CRP/index

.htm"

end if



If Request("action")="Return To Navigation Screen" and (Session("title")

="Superuser" or Session("title")="admin") then

	Response.redirect "navscreen_admin.asp"

Elseif Request("action")="Return To Navigation Screen" then

	Response.redirect "navscreen.asp"

end if



If Request("cmdSubmit")="Submit" then

	rs3.fields("AUTO_COAL") = Request.form("AUTO")	

	rs3.fields("serial") =  Request.form("serial_num")

end if

%>



<Script Language=VBScript>



sub cmdSubmit_OnClick()	  	  

	document.EPM_direct.submit

end sub



</Script>

<html>



<head>

<meta http-equiv="Content-Type" content="text/html;charset=windows-1252">

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>EPM/COAL_main</title>

<base target="bottom">

</head>



<body background="images/c130.jpg" bgproperties="fixed">



<form method="post" name="EPM_direct" target="_top">

  <div align="center">

    <center>

    <table border="0" cellspacing="1" height="13" width="977" 

style="border: 2 solid #000000">

      <% Do while not rs3.eof %>



      <tr>

        <th style="border-style: solid; border-width: 1" align="center" 

bordercolor="#000000" width="21" height="9">

          <p align="center"><b><font size="2" face="Arial"><% = rs3("div") 

%></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="96">

          <p align="center"><b><font size="2" face="Arial"><% = rs3("ims") 

%></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="78">

          <p align="center"><b><font size="2" face="Arial"><% = rs3

("pmsb") %></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="99">

          <p align="center"><b><font size="2" face="Arial"><% = rs3("nsn") 

%></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="92">

          <p align="center"><b><font size="2" face="Arial"><% = rs3

("scrubbed_qty") %></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="107">

          <p align="center"><b><font size="2" face="Arial"><% = rs3

("scrub_USP_if_COAL") %></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="88">

          <p align="center"><b><font size="2" face="Arial"><% = rs3

("scrubbed_qty_cost") %></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="64" valign="middle">

          <p align="center" style="margin-left: 0; margin-top: 0; margin-

bottom: 0"><input type="text" name="serial_num" size="7"></p>

        </th>

        <center>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" width="47" valign="middle">

          <p align="center"><b><font size="2" face="Arial"><% = rs3("pcn") 

%></font></b></p>

        </th>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" valign="middle" width="137">

          <p align="center"><input type="checkbox" name="AUTO_COAL" 

value="No" style="text-align: Center">No</p>

        <th height="9" style="border-style: solid; border-width: 1" 

align="center" bordercolor="#000000" valign="middle" width="46">

          <p align="center"><b><font size="2" face="Arial"><% = rs3

("fcrn") %></font></b></th>

        </tr>

        </form>

        <%rs3.movenext

   loop

   rs3.close

        %>



      </table>

    </center>

    </div>

    <div align="center">

      <center>

      <table border="0" cellspacing="1" width="972" height="35">

        <tr>

          <td width="967" height="20" valign="middle" align="center">

            <form name="actions" method="POST" target="_top">

              <p align="center" style="word-spacing: 0; line-height: 100%; 

margin: 0"><input type="submit" value="Submit" name="cmdSubmit"></p>

            </form>

            <form name="redirects" target="_top" method="POST">

              <p align="center" style="word-spacing: 0; line-height: 100%; 

margin: 0"><input type="submit" value="Logout" name="action"><input 

type="submit" value="Return To Navigation Screen" name="action"></p>

            </form>

        </tr>

      </table>

      </center>

    </div>

  </center>



</body>




  Return to Index