USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Dicas

  ASP - Active Server Page    (Miscelâneas)

Título da Dica:  Inserir dados com checkbox no acess
Postada em 2/10/2003 por ^HEAVY-METAL^            
Formulario 1

<html>

<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<link rel="STYLESHEET" type="text/css" href="coolmenus.css">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Coordenadoria Econômico Financeiro Criação de RAPs</title>
</head>

<body topmargin="0" leftmargin="2" marginwidth="0" marginheight="0">
<script src="coolmenus_frame.js" type="text/javascript"></script>

<form method="Post" action="diariorap_aformulario2.asp" target="_blank">
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td align="center" colspan="2"><font face="Verdana" size="2">Datas e Previsões</font></td>
<td align="center"><font face="Verdana" size="2">Procedimentos</font></td>
</tr>
<tr>
<td align="center"><input type="checkbox" name="<%="Pg"&"0"%>" value="1">

Enviar p/Pagamento</td>
</tr>
<tr>
<td align="center"><input type="checkbox" name="<%="Pg"&"1"%>" value="2">

Enviar P/Seguro</td>
</tr>
<tr>
<td align="center"><input type="checkbox" name="<%="Pg"&"2"%>" value="3">

Aviso Requisitante</td>
</tr>
<tr>
<td align="center" rowspan="2"><input type="checkbox" name="<%="Pg"&"3"%>" value="4">

Aviso Favorecido</td>
</tr>
<tr>
</tr>
</table>
<input type="hidden" name="Controle" value="3"><font face="Verdana" size="1"><font face="Verdana"><input type="submit" value="Enviar" name="Avisos"></font><input type="button" value="Voltar" onclick="javascript:history.back()" name="voltar"></font>
</form>
</body>

</html>


Inserir

<%response.Buffer=True%>
<!--METADATA NAME= "Microsoft ActiveX Data Objects 2.5 Library"TYPE="Typelib" UUID={00000205-0000-0010-8000-00AA006D2EA4="-->
<!--#include file="..\conexao\biblioteca-conexao.asp" -->
<!--#include file="..\conexao\javacat.inc" -->
<html>

<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Nova pagina 1</title>
</head>

<body topmargin="0" leftmargin="2" marginwidth="0" marginheight="0">
<%
dim total,strsql,rsrap,conexaosql,qtde
Dim myMail
'ccusto=Cint(session("Crdrap"))
ccusto=session("Crdrap")
avisos=0

if request("Avisos")<>"" then

for Controlei=0 to request("controle")

if request("Pg"&Controlei)<>"" then

response.write request("Pg"&Controlei)


Set conexao = Server.CreateObject("ADODB.Connection")
'conexao.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:/w_bamboo/ger/acess/tabelabox.mdb;"
conexao.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:/Inetpub/wwwroot/acess/TABELABOX.mdb"
'conexaoado.Open conexao

strsql ="INSERT INTO TABELABOX ( BOX1 ) "
strsql = strsql & "values ('"&request("Pg"&Controlei)&"')"
'strsql = "INSERT INTO TABELABOX box1 = "& "1"
response.write strsql
Set rs = conexao.execute(strsql)

'+adCmdText + adExecuteNoRecords


'

'conexao.Execute(strsql)
'rs.close
conexao.close
set conexao =nothing

avisos=avisos+1
end if



next%>
<script>
alert("registrados <%=avisos%> com exito. Obrigado");
parent.parent.close();
</script>
<%




end if%>

</body>
</html>

T+,
 


CyberWEB Network Ltda.    © Copyright 2000-2017   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página