Update vários registros
Opa...boa noite....preciso muito realizar um UPDATE em varios registros e nao estou conseguindo...alguma alma boa pode me ajudar??rs
Segue codigo formulario :
<form id="formulario" name="formulario" method="post" action="atualiza_ranking.asp">
<%
While ((Repeat1__numRows <> 0) AND (NOT Busca.EOF))
%>
<%=(Busca.Fields.Item("Cod_ind").Value)%>-
<input name="ranking<%=(Busca.Fields.Item("Cod_ind").Value)%>" type="text" id="ranking<%=(Busca.Fields.Item("Cod_ind").Value)%>" value="<%=(Busca.Fields.Item("Ranking").Value)%>" />
</select>
<label></label>
<br />
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Busca.MoveNext()Wend
%>
<input name="botao" type="submit" value="Atualizar todos os dados!" />
</form></body>
</html>
Segue codigo da pagina de UPDATE
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/Base_GIP.asp" -->
<%
Set RSfotos_cmd = Server.CreateObject ("ADODB.Command")
RSfotos_cmd.ActiveConnection = MM_Base_GIP_STRING
RSfotos_cmd.CommandText = "SELECT Cod_ind FROM dbo.PIND_Indicador"
RSfotos_cmd.Prepared = true
Set RSfotos = RSfotos_cmd.Execute
RSfotos_numRows = 0
%>
<%
While Not RSfotos.EOF
id = RSfotos("Cod_Ind")
ranking = Request("ranking" & id)
'sessao = Request("sessao" & id)
RSfotos_cmd.CommandText = "UPDATE pind_indicador SET ranking = '"&ranking&"' " &_
" WHERE Cod_ind = " &id
RSfotos.MoveNext
Wend
response.Write(ranking)
%>
<%
RSfotos.Close()
Set RSfotos = Nothing
%>
Obrigado por qualquer LUZZZZZZZZZZZZZZZZZZZZZ
Discussão (5)
Carregando comentários...