Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Espanhol

Delete em um sistema de boletim informativo

Recommended Posts

Olá pessoal do imasters ! Estou com um problema num sistema de remoção de email de um boletim informativo. Quando coloco um email pra remover ocorre um erro. Já dei uma olhada aqui em tudo, reolhei e o bicho tá pegando... se puderem me ajudar :) Abraço a todos.

 

O erro:

------------------------------------------------------------------------

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

 

[MySQL][ODBC 3.51 Driver][mysqld-4.1.18-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM boletim_dados WHERE email = djespanhol@hotmail.com' at line 1

 

/boletim/del_email.asp, line 10

--------------------------------------

 

--------------------------

arquivo deletar_mail.asp

--------------------------

 

<html><head><title>Boletim Informativo</title><LINK href="../arquivos/style.css" type=text/css rel=stylesheet><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><script>function validar(){var email=document.form.email.value;if (email==""){alert("Você deve digitar o seu E-mail para ser removido")document.form.email.focus()return false}if (email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1){ alert("Digite um E-mail válido");		document.form.email.focus()		return false		}}</script><body topmargin="10"><table width="347" border="0" align="center" cellpadding="0" cellspacing="0">  <tr> 	<td height="30" bgcolor="#F8F8EF"><div align="center" class="notcham">Boletim Informativo</div></td>  </tr></table><div align="center"></div><form method="POST" name="form" action="del_email.asp" onsubmit="return validar()">    <table width="347" height="93" border="0" align="center" cellpadding="0" cellspacing="0">	<tr> 	  <td height="30" class="texto"> <div align="center">Digite o seu email no 		  campo abaixo para remover:</div></td>	</tr>	<tr> 	  <td height="33"> <div align="center"><strong><font size="2" face="Verdana"> 		  <input name="email" type="text" class="form2" size="30">		  </font></strong></div></td>	</tr>	<tr> 	  <td height="30"> <div align="center"> 		  <input name="submit" type="submit" class="form2" value="Remover meu E-mail">		</div></td>	</tr>  </table></form></html>

 

--------------------------

arquivo del_mail.asp

--------------------------

<!--#include file="conectar.asp"--><%AbreConexao'Recupero os dadosDim emailemail = replace(request.form("email"), "'", "''")deletar = "DELETE * FROM boletim_dados WHERE email = " & email &""Conexao.Execute(deletar)FechaConexao%><html><head><title>Boletim Informativo</title><LINK href="../arquivos/style.css" type=text/css rel=stylesheet><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body topmargin="10"><table width="347" border="0" cellspacing="0" cellpadding="0">  <tr> 	<td height="30" bgcolor="#F8F8EF"><div align="center" class="notcham">Boletim Informativo</div></td>  </tr></table> <table width="347" height="112" border="0" cellpadding="0" cellspacing="0">  <tr> 	<td height="19" class="texto"> </td>  </tr>  <tr> 	<td height="30" class="texto"> <div align="center">O e-mail <strong><%= email = Request.Form ( "email" ) %><%=email%></strong> 		  foi removido com sucesso.</div></td>  </tr>  <tr> 	<td height="33"> <div align="center"><strong><font size="2" face="Verdana"> 		  </font></strong></div></td>  </tr>  <tr> 	<td height="30"> 	  <div align="center"> 		  		<input name="submit" type="submit" class="form2" value=" Fechar" onClick="javascript:window.close();">	  </div></td>  </tr></table></form></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites
deletar = "DELETE * FROM boletim_dados WHERE email = '" & email &"'"
e-mail e texto, deve ir entre aspas simpes '

Compartilhar este post


Link para o post
Compartilhar em outros sites

falow grande J. valeu pela dica...... conversei com um amigo meu aqui e aí fizemos uma muqueca no código da action e aí ficou lindo.abrço

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.