Hola a Todos!, Sres. haber si me explico.
Tengo el siguiente problema:
Estoy utilizando un Input Text para introducir unos valores haciendo update en una tabla.
Para esto estoy unsando un bucle For Each. Pero resulta que esta haciendo update a toooda la tabla con el primer valor que tiene el primer input Text.
Estoy usando esta código:
sql5="select cod_kpi_metrics from ind_confirmacion_temporal where left((cod_kpi_metrics),10)='"&request("codi")&"' and Close_date='"&fechacierre&"'"
rs5.Open sql5,OConn_TMonitoreo1,3,3
Dim targets(), I
I = 0
For Each Valor In Request.Form("targetbox1") while not rs5.eof
Redim Preserve targets(I)
targets(I) = Valor
codigotemporal=rs5.fields(0)
set rs6=Server.CreateObject("ADODB.Recordset")
sql6="update ind_confirmacion_temporal set target="&Valor&" where cod_kpi_metrics='"&codigotemporal&"' and Close_date='"&fechacierre&"'"
rs6.Open sql6,OConn_TMonitoreo1,3,3
rs5.movenext
wend
I = I + 1
next
Les agradecería mucho su ayuda
Antes del update: Después del Update
______ _______
A | 1 | A | 1 |
------- --------
B | 2 | B | 1 |
------- --------
C | 3 | C | 1 |
------- --------
Me entienden yo en los input text introduzco 1, 2 , 3 y cuando hago el update solo me toma encuenta el primer valor y lo introduce a todos los registros quedando 1,1,1.