• 0
Sign in to follow this  
maktub

Alguém Pode Me Ajudar

Question

Bem tenho um código onde o operador seleciona um item e é computado em um banco de dados esses dois scripts abaixo são para zerar o campo na tabela de bd mas esta dando erro e eu não acho, segue os códigos abaixo:

perguntas.asp

<%
if session("brquizadmin") <> "logado" then
response.redirect "default.asp"
else
%>
<!--#include file="config.inc" -->
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Administração</title>
</head>

<body>
<p align="center"><img border="0" src="logo_admin.gif" width="406" height="110"></p>
<p align="center">
<%
strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(bdados)
Set conn = Server.CreateObject("ADODB.Connection")
conn.open strCon
sql = "SELECT * FROM enquete_respostas"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = 3
rs.CursorLocation = 3
rs.LockType = 3
rs.Open sql, conn
%>
<b><font size="2" color="#000080" face="Arial">Informações sobre a
tabulação Geral</font><br><br>
<div align="center">
  <center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td width="20%" valign="middle" align="center"><b><font face="Arial" color="#000080" size="2">Código</font></b></td>
   <td width="20%" valign="middle" align="center"><b><font face="Arial" color="#000080" size="2">Id Tabulação</font></b></td>
   <td width="20%" valign="middle" align="center"><b><font face="Arial" color="#000080" size="2">Nomenclatura</font></b></td>
   <td width="20%" valign="middle" align="center"><b><font face="Arial" color="#000080" size="2">Número de tabulação</font></b></td>
     <td width="20%" valign="middle" align="center"><b><font face="Arial" color="#000080" size="2">Zerar</font></b></td>
 </tr>
</table>
  </center>
</div>
<% While Not rs.eof %>
<div align="center">
  <center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td width="20%" valign="middle" align="center"><font face="Arial" size="1"><%=rs("ID_resposta")%></font></td>
   <td width="20%" valign="middle" align="center"><font face="Arial" size="1"><%=rs("ID_enquete")%></font></td>
   <td width="20%" valign="middle" align="center"><font face="Arial" size="1"><%=rs("respostas")%></font></td>
   <td width="20%" valign="middle" align="center"><font face="Arial" size="1"><%=rs("hits")%></font></td>
   <td width="20%" valign="middle" align="center"><a href="../apagar.asp?Resposta=<%=rs("ID_resposta")%>"><font size="1" face="Arial"><img border="0" src="delete_path.gif" width="21" height="23"></font></a></td>
 </tr>
</table>
  </center>
</div>
<%
rs.MoveNext
Wend
%>
<br><br>

</body>
</html>
<% end if %>
e apagar.asp
<!--#include file="conn/conexao.asp"-->
<% 
cBanco  = Server.MapPath("db/Enquete.mdb")
Set Conn = Server.CreateObject("adodb.connection")
strConn = "Provider = Microsoft.Jet.oledb.4.0; Data Source = "& cBanco &";"
Set Rs = Server.CreateObject("adodb.recordset")
Conn.Open(strConn)
ID_resposta = Request.QueryString("ID_resposta")
Set.Open "UpDate Enquete_respostas Set Hits ='0' Where ID_resposta ='"& ID_resposta &"'", Conn, 3,3 
%>

<br><p align="center">
<a href="admin/deleta.asp"><img border="0" src="voltar.gif" WIDTH="66" HEIGHT="19"></a>
<p align="center">
<br><br>
<a href="logout.asp"><img border="0" src="logout.gif" WIDTH="151" HEIGHT="29"></a></p>

me ajudem please

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

:rolleyes:

Qual é o erro que dá?

Share this post


Link to post
Share on other sites
  • 0

Brother!!!

<%
Dim Rs, Atualizar
Set Rs = Server.CreateObject("adodb.recordset")
Rs.Open "UPDATE Enquete_Respostas SET Hits ='0' Where ID_Resposta = '"& Id_Resposta &"';", Conn, 3,3 
%>

Olha ai... fiz por cima, veja se funciona..

Abraçus!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this