Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) erro no update


Martinsrj

Pergunta

Olá pessoal boa tarde!

Estou me deparando com o seguinte erro:

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

[MySQL][ODBC 5.1 Driver][mysqld-5.1.35-community]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 ' id, sistema, descricao, cod_grupo, observacao, fase, plano_entrega, dt_inc stat' at line 1

/conteudo/grupo_demanda/cod/alt3.dados.asp, line 34

Observação, a linha 34 é essa: Set rsDados = conbd_gd1.Execute(strALT)

Segue abaixo o código da pagina:

alt3.dados.asp

<% Option Explicit %>
<!--#Include file="conexao.asp"-->
<%
Dim conbd_gd1, rsInsere, strALT, var_status, var_id, var_sistema, var_descricao, var_cod_grupo, var_observacao, var_fase, var_plano_entrega, var_dt_inc, data, hora, Minuto, Segundo, varIDcod

varIDcod = TRIM(Request.Form("coddados"))
var_status = TRIM(Request.Form("txt_status"))
var_id = TRIM(Request.Form("txt_id"))
var_sistema = TRIM(Request.Form("txt_sistema"))
var_descricao = TRIM(Request.Form("txt_descricao"))
var_cod_grupo = 1
var_observacao = TRIM(Request.Form("txt_observacao"))
var_fase = TRIM(Request.Form("txt_fase"))
var_plano_entrega = TRIM(Request.Form("txt_plano_entrega"))

Call AbreConexao
strALT = "UPDATE tab_dados SET status, id, sistema, descricao, cod_grupo, observacao, fase, plano_entrega, dt_inc "
'-- strALT = strALT & "(status, id, sistema, descricao, cod_grupo, observacao, fase, plano_entrega, dt_inc) "

strALT = strALT & "status & '" & varIDcod & "',"
strALT = strALT & "status & '" & var_status & "'," 
strALT = strALT & "status & '" & var_id & "',"
strALT = strALT & "status & '" & var_sistema & "'," 
strALT = strALT & "status & '" & var_descricao & "',"
strALT = strALT & "status & '" & var_cod_grupo & "'," 
strALT = strALT & "status & '" & var_observacao & "',"
strALT = strALT & "status & '" & var_fase & "',"
strALT = strALT & "status & '" & var_plano_entrega & "'," 
strALT = strALT & "status & '" & var_observacao & "',"
strALT = strALT & "WHERE cod_dados = " & varIDcod & " "

'Response.Write strALT
'Response.End
Set rsDados = conbd_gd1.Execute(strALT)
Call FechaConexao
Set rsDados = Nothing
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<link href="estilos_portabilidade.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
body {
    margin-left: 0px;
}
-->
</style></head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="topo.asp"--></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#f5f5f5"><div align="center"> <br />
          <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
              <td height="200" valign="top" bgcolor="#FFFFFF"><div align="center"> <br />
                  <table width="98%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="20"><div align="center"><span class="style2">Alterado com sucesso</span></div></td>
                  </tr>
                </table> 
                <br />
                <br />
              
              </div></td>
            </tr>
          </table>
        <br />
    </div></td>
  </tr>
</table><!--#include file="rodape.asp"-->
</body>
</html>
Na pagina alt2.dados.asp está recuperandoos dados Segue abaixo o código:
<%
Option Explicit
%>
<!--#Include file="conexao.asp"-->
<%
Dim conbd_gd1, rsDados, strSQL, cod_altera, var_descricao, var_observacao, var_planodeEntrega

cod_altera = Request.QueryString("cod_dados1")
Call AbreConexao
strSQL = "SELECT * FROM tab_dados "
strSQL = strSQL & " WHERE cod_dados = " & cod_altera
'-- response.write strSQL
Set rsDados = conbd_gd1.Execute(strSQL)
var_descricao = rsDados("descricao")
var_observacao = rsDados("observacao")
var_observacao = rsDados("observacao")
var_planodeEntrega = rsDados("plano_entrega")

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<link href="estilos_portabilidade.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
body {
    margin-left: 0px;
}
-->
</style></head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="topo.asp"--></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#f5f5f5"><div align="center"> <br />
          <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
              <td height="200" valign="top" bgcolor="#FFFFFF"><div align="center"> <br />
                  <table width="98%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="20"><span class="style2">Alteração de Dados</span></td>
                  </tr>
                </table> 
                <br />
                <table width="99%" border="0" cellspacing="0" cellpadding="0">
                  <form name="alteracao" method="POST" action="alt3.dados.asp"><tr>
                    <td><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td width="14%" height="35" bgcolor="f4f4f4" class="style3"><div align="right">Status:</div></td>
                        <td bgcolor="f4f4f4">
                           <input type="text" name="txt_status" value="<% = rsDados("status") %>" size="10" class="campocombo" id="txt_status" /></td>
                      </tr>
                      <tr>
                        <td height="35" bgcolor="f4f4f4" class="style3"><div align="right">ID:</div></td>
                        <td height="35" bgcolor="f4f4f4"><label>
                           <input type="text" name="txt_id" value="<% = rsDados("id") %>" size="10" class="campocombo" id="txt_status" />
                        </label>                          <div align="right" class="style3"></div></td>
                        </tr>
                      <tr>
                        <td height="35" bgcolor="f4f4f4" class="style3"><div align="right">Sistemas:</div></td>
                        <td bgcolor="f4f4f4"><label>
                        <input type="text" name="txt_sistema" value="<% = rsDados("sistema") %>" size="10" class="campocombo" id="txt_sistema" />
                        </label></td>
                      </tr>
                      <tr>
                        <td height="100" bgcolor="f4f4f4" class="style3"><div align="right">Descrição/ Impacto:</div></td>
                        <td bgcolor="f4f4f4"><label>
                          <textarea name="txt_descricao" id="txt_descricao" cols="50" rows="7" class="campocombo"><% = var_descricao %></textarea>
                        </label></td>
                      </tr>

                      <tr>
                        <td height="100" bgcolor="f4f4f4" class="style3"><div align="right">Observação:</div></td>
                        <td bgcolor="f4f4f4"><label>
                          <textarea name="txt_observacao" id="txt_observacao" cols="50" rows="7" class="campocombo"><% = var_descricao %></textarea>
                        </label></td>
                      </tr>
                      <tr>
                        <td height="35" bgcolor="f4f4f4" class="style3"><div align="right">Fase:</div></td>
                        <td bgcolor="f4f4f4"><label>
                          <input type="text" name="txt_fase" value="<% = rsDados("fase") %>" size="10" class="campocombo" id="txt_fase" />
                        </label></td>
                      </tr>
                      <tr>
                        <td height="100" bgcolor="f4f4f4" class="style3"><div align="right">Plano de Entrega:</div></td>
                        <td bgcolor="f4f4f4"><label>
                          <textarea name="txt_plano_entrega" id="txt_plano_entrega" cols="50" class="campocombo" rows="7"><% = var_planodeEntrega %></textarea>
                        </label></td>
                      </tr>
                      <tr>
                        <td height="50" bgcolor="f4f4f4">&nbsp;</td>
                        <td bgcolor="f4f4f4"><label>
                        <input type="hidden" name="coddados" value="<% = rsDados("cod_dados") %>" />
                        <br>  <input type="submit" name="btEnvia" id="button" class="botao" value="Alterar" />
                          <input type="reset" name="btLimpa" id="btLimpa" class="botao" value="Consultar" />
                          <% response.write request.querystring("id") %>
                        </label></td>
                      </tr>
                    </table></td>
                  </tr></form>
                </table>
                <br />
              
              </div></td>
            </tr>
          </table>
        <br />
    </div></td>
  </tr>
</table><!--#include file="rodape.asp"-->
</body>
</html>
Aqui está todos os campos da minha tabela:
tab_dados  CREATE TABLE `tab_dados` (               
             `cod_dados` int(10) NOT NULL,          
             `status` varchar(100) DEFAULT NULL,    
             `id` varchar(10) DEFAULT NULL,         
             `sistema` varchar(20) DEFAULT NULL,    
             `descricao` text,                      
             `cod_grupo` varchar(12) DEFAULT NULL,  
             `observacao` text,                     
             `fase` varchar(20) DEFAULT NULL,       
             `plano_entrega` text,                  
             `dt_inc` datetime DEFAULT NULL,        
             PRIMARY KEY (`cod_dados`)              
           ) ENGINE=InnoDB DEFAULT CHARSET=utf8

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Visitante
Este tópico está impedido de receber novos posts.


  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,3k
×
×
  • Criar Novo...