Página de inserção de dados que é submetida 2 vezes!!! strAction = request("action")
strPage = request("page")
if strAction = "" then
'Response.Redirect ("")
Response.End
end if
strCodConjunto = request("cbo_conjunto")
strNum_Ano = request("Num_Ano")
select case strAction
'rotina para inclusao de registro na base
case "incluir"
j=0
for i = 1 to 6
if (i = 1) or (i = 2) or (i = 3) then
strIndicador = 4
j = j + 1
else
if i = 4 then
j = 0
end if
j = j + 1
strIndicador = 5
end if
strVlr_Padrao(i) = request("vlr_padrao" & i)
'insere vlr no banco
strSQL = "INSERT INTO TB_PADRAO_DEC_FEC (cod_indicador, cod_conjunto, num_ano, cod_periodo, vlr_padrao)"
strSQL = strSQL & "VALUES (" & strIndicador & ", '" & strCodConjunto & "'," & strNum_Ano & "," & j & "," & strVlr_Padrao(i) & ")"
'Response.Write strSQL
'Response.End
conexao rs, strSQL, "add", Application("ConnectionStringSQL")
if errnumber <> 0 then
if errnumber = -2147217873 then 'erro de primary key
vErro = "Registro já Existente !"
else 'erro não esperado pelo sistema
vErro = "Erro:" & msgerro & "-" & errnumber
end if
end if
next Editado: Use as Tags CODE e QUOTE para formatar seus POSTS!