Housemouse1
Technical User
I created a form for individuals to select their manpower by name. They select their manpower by putting a checkbox by the name. Then they click a button, a confirmation page appears with the user's new manpower list.
The problem is, after the user clicks the checkbox, I can't get the checkbox value to update into the database (MS Access) table. The database table name is [d_Manpower] and the column I am trying to update is [Keep]. Below is the code for the checkbox:
<TD><Input Type=Checkbox Name="Keep" Value=1></TD>
Next is the code for the comfirmation page (I apologize for the length but I am desperate!):
<%@ Language=VBScript %>
<% 'Page Goal:Confirmation page is to show new Manpower that was check-marked. Check mark value
'is updated in Sonydemo database in table d_Manpower %>
<%
'Note: To select the new OCC column from the Manpower table for the designated oracle cost center
'and update field Keep with checkbox value.
dim rs
Set rs = server.CreateObject("ADODB.Recordset"
rs.Open "SELECT * FROM [d_Manpower] WHERE OCC='" & Session("OCC" & "'", DBConn
rs.Fields("Keep" = "Keep"
rs.Update
if rs.EOF then
rs.Close
set rs = nothing
Response.Redirect "../common/inv_acs.asp"
end if
%>
<html>
<head>
<title>Manpower Confirm</title>
</head>
<body>
<!-- #include file="../common/hdr.asp" -->
<%
'write what is in the database fields
If rs.Fields("Keep" = 1 then
%>
<H3>Here is your updated manpower:</H3>
<%
Do While NOT rs.EOF
Response.Write "<TABLE BORDER ='1'>"
Response.Write "<TR>"
Response.Write "<TD>"
Response.Write rs("New_OCC"
Response.Write "</TD>"
Response.Write "<TD>"
Response.Write rs("Emply_No"
Response.Write "</TD>"
Response.Write "<TD>"
Response.Write rs("Name"
Response.Write "</TD>"
Response.Write "<TD>"
Response.Write rs("Job_Title"
Response.Write "</TD>"
rs.MoveNext
loop
end if
rs.Close
Set rs = nothing
%>
</body>
</HTML>
The problem is, after the user clicks the checkbox, I can't get the checkbox value to update into the database (MS Access) table. The database table name is [d_Manpower] and the column I am trying to update is [Keep]. Below is the code for the checkbox:
<TD><Input Type=Checkbox Name="Keep" Value=1></TD>
Next is the code for the comfirmation page (I apologize for the length but I am desperate!):
<%@ Language=VBScript %>
<% 'Page Goal:Confirmation page is to show new Manpower that was check-marked. Check mark value
'is updated in Sonydemo database in table d_Manpower %>
<%
'Note: To select the new OCC column from the Manpower table for the designated oracle cost center
'and update field Keep with checkbox value.
dim rs
Set rs = server.CreateObject("ADODB.Recordset"
rs.Open "SELECT * FROM [d_Manpower] WHERE OCC='" & Session("OCC" & "'", DBConn
rs.Fields("Keep" = "Keep"
rs.Update
if rs.EOF then
rs.Close
set rs = nothing
Response.Redirect "../common/inv_acs.asp"
end if
%>
<html>
<head>
<title>Manpower Confirm</title>
</head>
<body>
<!-- #include file="../common/hdr.asp" -->
<%
'write what is in the database fields
If rs.Fields("Keep" = 1 then
%>
<H3>Here is your updated manpower:</H3>
<%
Do While NOT rs.EOF
Response.Write "<TABLE BORDER ='1'>"
Response.Write "<TR>"
Response.Write "<TD>"
Response.Write rs("New_OCC"
Response.Write "</TD>"
Response.Write "<TD>"
Response.Write rs("Emply_No"
Response.Write "</TD>"
Response.Write "<TD>"
Response.Write rs("Name"
Response.Write "</TD>"
Response.Write "<TD>"
Response.Write rs("Job_Title"
Response.Write "</TD>"
rs.MoveNext
loop
end if
rs.Close
Set rs = nothing
%>
</body>
</HTML>