Update Using Radio Button in ASP

Update Using Radio Button in ASP

am 02.12.2004 19:55:47 von lp_us2004

Hi
I am trying to retrieve information from the Access database using
RADIO button. I am using UPDATE command in ASP. I am able to update
the information using RADIO buttons. HOWEVER, I am not able to
retrieve the previous value of Radio button (ie Yes/No) already
available in the database before UPDATING (Yes/No) inofrmation. Any
help will be greatly appreciated. I am using the following ASP codes.

TR>
1. Contract:

Yes > No >  





The detailed codes are below:


<%@ Language=VBScript %>
<%
if isempty(Session("EmpID")) then
Response.Redirect "index.asp"
end if
%>





<%
if NOT isempty(Request.Form("update_st")) then
conn.Execute "update St_Per_Eval set " _
& "Name = '" & Session("EmpID") & "', " _
& "St_LastName = '" & Request.Form("St_LastName") & "', " _
& "Intern_Org = '" & Request.Form("Intern_Org") & "', " _
& "Supervisor_Name = '" & Request.Form("Supervisor_Name") & "', " _
& "commitment = '" & Request.Form("commitment") & "', " _
& "HoursPerWeek = '" & Request.Form("HoursPerWeek") & "', " _
& "additional_interns = '" & Request.Form("additional_interns") & "'
where " _
& "StudentID1 = " & Request.Form("StudentID1")& " and Status = 'In
Progress' "



response.redirect "manage.asp"

elseif Request.QueryString("view") = "St_LastName" then
set rsEmps = conn.Execute("select * from St_Per_Eval where
St_LastName = '" _
& Request.QueryString("St_LastName") & "'" & "order by St_LastName")
else
set rsEmps = conn.Execute("Select * from St_Per_Eval where StudentID1
= " _
& Request.QueryString("StudentID1"))


Session("StudentID1") = rsEmps("StudentID1")
end if
%>







Update











">









































Name: " SIZE=40 MAXLENGTH=50 >
Organization: " SIZE=40 MAXLENGTH=50 >
Supervisor: " SIZE=40 MAXLENGTH=50
>
1. Contract: Yes > No >  








Would you like to take additional
information:
Yes > No >  


















Re: Update Using Radio Button in ASP

am 02.12.2004 20:01:31 von unknown

I don't believe that you'll be able to avoid first doing a SELECT query to
get the value first since you're using Access. So, "SELECT..." to get the
current value and then execute your update (if necessary).

Another option is to have the old value in a hidden input on the form. The
problem with this is that people can "trick" your code, since it's relying
on the data coming from the browser being honest.

Ray at work


"Naveen" wrote in message
news:71c9f44e.0412021055.6e4b6d24@posting.google.com...
> Hi
> I am trying to retrieve information from the Access database using
> RADIO button. I am using UPDATE command in ASP. I am able to update
> the information using RADIO buttons. HOWEVER, I am not able to
> retrieve the previous value of Radio button (ie Yes/No) already
> available in the database before UPDATING (Yes/No) inofrmation. Any
> help will be greatly appreciated. I am using the following ASP codes.
>
> TR>