Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
ola
tenhu um sistema de um boletim online, tenhu 12 tabelas dentro do bd, dentro do bd os alunos sao identificados por um ID, tipo la dentro tem o ID dele e na frente as notas cadastradas, quando eu fo excluir eu preciso exlui o ID e todos os dados q estao a frente do seu nome, tipow criei uma page q seleciona na tabela de login, o ID doi aluno e o nome dele, dai eu escolho o aluno e clico num checkbox q manda o id pa otra page e ali ela tem q executa a exclus'ao do id em todas as tables
abaixo esta o codigo
pagina de selecao de alunos
<%
Option Explicit
Response.Expires = 0
Dim objConn, objRs, strQuery
Dim strConnection
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DBQ=" & Server.MapPath("./dados/dados.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}","username","password"
strQuery = "SELECT * FROM admin"
Set ObjRs = objConn.Execute(strQuery)
%>
<html>
<LINK REL=stylesheet HREF="liks_etc.css" TYPE="text/css">
<head>
<title>Exclusão</title>
</head>
<body bgcolor="#FFFFFF">
<div align="center" style="width: 756; height: 119">
<table width="710" border="0" cellspacing="0" cellpadding="0" height="1">
<tr>
<td width="448" valign="top" height="136">
<table border="0" cellpadding="0" cellspacing="0" width="740">
<tr bgcolor="ffffff">
<td colspan="3">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="14%" bgcolor="#f5f5f5">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="form_inclusao.asp" class="menu">Incluir</a></font></b></font></div></td>
<td width="19%" bgcolor="#f5f5f5">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#CCCCCC">Excluir</font></b></font></div></td>
<td width="34%" bgcolor="#f5f5f5">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="procura.asp" class="menu">Pesquisar</a></font></b></font></div></td>
<td width="33%" bgcolor="#f5f5f5">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#CCCCCC"><a href="escolhe_pra_auterar.asp" class="menu">Alterar</a></font></b></font></div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3">
<table width="736" border="0" cellspacing="0" cellpadding="0" height="18">
<tr>
<td width="734" height="1" align="center" bgcolor="#FFFFE6">
<font face="Verdana, Arial, Helvetica, sans-serif" color="#000099" size="3"><b><br>
</b></font><font size="2"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">::
Exclusão de Alunos::</font></b></font></td>
</tr>
</table>
<form method="GET" action="action_excluir.asp">
<table width="736" border="0" cellspacing="0" cellpadding="0" height="1">
<tr>
<td height="1" align="center" width="734">
<table border="0" width="403" height="63" cellpadding="2">
<tr bgcolor="#FF6600">
<td width="59" height="1" align="center"> <font size="1" color="FFFFFF"><b><font face="Verdana">Nº:</font></b>
</font></td>
<td width="439" height="1" align="center"> <font size="1" color="FFFFFF"><b><font face="Verdana">Nome:</font></b>
</font></td>
<td width="90" height="1" align="center"> <font size="1" color="FFFFFF">
<input type="submit" name="Submit" value="Excluir">
</font></td>
</tr>
<%While Not objRS.EOF %>
<tr bgcolor="#FFFFE6">
<td width="59" height="1" align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<%Response.write objRS("login")%>
</font> </b></font></div></td>
<td width="439" height="1" align="center"> <div align="left"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<%Response.write objRS("nome")%>
</font> </b></font></div></td>
<td width="90" height="1" align="center"> <div align="center"><font size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<input type="checkbox" name="checkbox" value="<%=objRS(0)%>">
</font> </b></font></div></td>
</tr>
<%
objRS.MoveNext
Wend
objRs.close
objConn.close
Set objRs = Nothing
Set objConn = Nothing
%>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
<<<<<<<<<<<<<<<<<<<<<<<<aqui o codigo a ser executado>>>>>>>>>
<%
Option Explicit
Response.Expires = 0
Dim objConn, stringSQL, strConnection, array_id, i, sql_id, id
id = Request.QueryString("checkbox")
On error Resume Next
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DBQ=" & Server.MapPath("contato.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}","username","password"
%>
<html>
<head>
<LINK REL=stylesheet HREF="file:///D|/exe/liks_etc.css" TYPE="text/css">
<title>Tela de Exclusão - ::ASPBRASIL::</title>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
if err = 0 and id <> "" then
array_id = split(id,",")
For i=0 to ubound(array_id)
sql_id = sql_id & "admin.login = " & Trim(array_id(i)) & " OR "
Next
sql_id = left(sql_id,(len(sql_id)-4))
stringSQL = "DELETE * FROM admin WHERE "&sql_id&""
objConn.Execute(stringSQL)
objConn.close
Set objConn = Nothing
end
%>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr align="center">
<td bgcolor="#f5f5f5" width="30%">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="file:///D|/exe/form_inclusao.asp" class="menu">Incluir</a></font></b></font></div>
</td>
<td bgcolor="#f5f5f5" width="30%">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="file:///D|/exe/form_exclui.asp" class="menu">Excluir</a></font></b></font></div>
</td>
<td bgcolor="#f5f5f5" width="35%">
<div align="center"><font color="#000099"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#CCCCCC"><a href="file:///D|/exe/escolhe_pra_auterar.asp" class="menu">Alterar</a></font></b></font></div>
</td>
</tr>
</table>
<table border="0" width="100%" height="8" cellpadding="2" align="center">
<tr bgcolor="#0099FF">
<td colspan="7" height="1" align="center"> <font size="2" color="FFFFFF"><b><font face="Verdana, Arial, Helvetica, sans-serif">Seus
dados foram excluidos com sucesso!</font></b></font> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
me ajudem ae browns
valews
--------------------
program nome;
var nome
var nome2
begin
nome:=luiz;
nome2:=antonio;
writeln ('O tempo as vezes é alheio a nossa vontade');
writeln ('so o q é bom dura tempo bastante pra se tornar');
writeln ('INESQUECIVEL');
writeln (nome+nome2);
end.
Carregando comentários...