I have this code and it only seems to updates the first record (the first time through the FOR loop).
I retrieve a string of CONFIRMED PARTICIPANTS, separated by commas, from my web page. Then I execute the below to update each CONFIRMED PARTICIPANT. If I display the query each time through, they look fine. Is there some constraint where you can only do one update in a connection?
connectstr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("access/mydatabase.mdb") & ";"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connectstr
Set rsData = Server.CreateObject("ADODB.Recordset")
g_input=split(request("participantselect"),",")
num_inputted=ubound(g_input)
for counter =0 to num_inputted
UserSQL = "Update tblActivities SET confirmed = true where ProgramId = "
UserSQL = UserSQL & "'" & InputProgramID & "'"
UserSQL = UserSQL & " and ParticipantID = "
UserSQL = UserSQL & "'" & g_input(counter) & "'"
Conn.execute UserSQL
next
Conn.Close
End If
I retrieve a string of CONFIRMED PARTICIPANTS, separated by commas, from my web page. Then I execute the below to update each CONFIRMED PARTICIPANT. If I display the query each time through, they look fine. Is there some constraint where you can only do one update in a connection?
connectstr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("access/mydatabase.mdb") & ";"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Connectstr
Set rsData = Server.CreateObject("ADODB.Recordset")
g_input=split(request("participantselect"),",")
num_inputted=ubound(g_input)
for counter =0 to num_inputted
UserSQL = "Update tblActivities SET confirmed = true where ProgramId = "
UserSQL = UserSQL & "'" & InputProgramID & "'"
UserSQL = UserSQL & " and ParticipantID = "
UserSQL = UserSQL & "'" & g_input(counter) & "'"
Conn.execute UserSQL
next
Conn.Close
End If