Sonasang:
There are some problems with your script; you are doing some unnecessary steps here.
What is the name of the field you are trying to update?
Radio buttons can be read by ASP via the Request object. You do not need to update the hidden form field with the user's gender selection. Use Request.Form("Radio") to get the value the user selected.
Also, the script you use to update your database is doing a lot more than it really should. I did not see anywhere in that script where you set a variable called
status1, either. Try this...
- <%
-
Dim gend
-
gend = Request.Form ("Radio")
-
-
if gend = "male" or gend = "female" then
-
Set objConn = Server.CreateObject("ADODB.Connection")
-
objConn.Mode = 3 '3 = adModeReadWrite
-
objConn.Open "Excel"
-
-
Set objRS = Server.CreateObject("ADODB.Recordset")
-
objRS.ActiveConnection = objConn
-
objRS.Source = "UPDATE Range1 SET fieldName = '"& gend &"' WHERE fieldID = ID"
-
objRS.Open
-
... etc...
-
All you have to do is UPDATE the database, so use an UPDATE sql query. In my query above, I put two variable field names which you should replace with your own.
fieldName = the field you are updating
fieldID = the unique field of your table - your primary key
I also put a variable in called ID.
ID = the value of the primary key for the record you are updating.