473,324 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

update records in the database by checkbox

hello

i want to update some records in the database by using checkboxes.
I wrote a code but it didn't work proparly. It update whole records not only the selected one by the checkbox. how can i do that????
this is my code

While ((Repeat1__numRows <> 0) AND (NOT rsAnswer2.EOF))
%>
<tr valign="baseline">
<td nowrap align="right"></td>
<td valign="top">
<input type="checkbox" name="answers" value="<%=(rsAnswer2.Fields.Item("answer_no").Valu e)%>" >
<option value="<%=(rsAnswer2.Fields.Item("answer_no").Valu e)%>"><%=(rsAnswer2.Fields.Item("answers").Value)% ></option> &nbsp; &nbsp;&nbsp;&nbsp; </td>
<td valign="top"><%=(rsAnswer2.Fields.Item("counts").V alue)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsAnswer2.MoveNext()
Wend
%>

update page:
<%


set cmdUpdateAns = Server.CreateObject("ADODB.Command")
cmdUpdateAns.ActiveConnection = MM_srcsurvey_conn_STRING
cmdUpdateAns.CommandText = "UPDATE answers SET counts = counts + 1 WHERE answer_no= " & request.querystring("answers")
cmdUpdateAns.CommandType = 1
cmdUpdateAns.CommandTimeout = 0
cmdUpdateAns.Prepared = true
cmdUpdateAns.Execute()


%>
Sep 25 '06 #1
0 1868

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: A.Dagostino | last post by:
hi i need to update an SQL Table when user select or unselect a checkbox control. How Can i do? Thanks Alex
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
0
by: sukaina | last post by:
hello i want to update some records in the database by using checkboxes. I wrote a code but it didn't work proparly. It update whole records not only the selected one by the checkbox. how can i...
6
by: mukeshrasm | last post by:
Hi I want to update records in database based on selected records using checkbox. if user does not select a record and clicks update button it should show the message please select record to be...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.