Jump to content
Fórum Script Brasil
  • 0

Erro De Syntax


smez
 Share

Question

Tipo de erro:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

[Microsoft][ODBC SQL Server Driver]

[SQL Server]Line 1: Incorrect syntax near '='.
/wd5/wmskyel/ProjetoASP/admin/importantes.asp, line 51



Set rs = CreateObject("ADODB.Recordset")

CdContaUsuario = Request.QueryString("CdContaUsuario")
strvalor = Replace(Replace(request.form("txtValor"),chr(39),"''"),"--","")

SQL = "UPDATE ContatoUsuario SET Valor = '"& strvalor &"' WHERE CdContatoUsuario = "&Request.QueryString("CdContaUsuario")
set rs = abredb.execute(SQL)

Response.Redirect("editPerfil.asp")
rs.close
set rs = nothing

o que pode ser esse erro??

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

eu fiz assim no sql

UPDATE ContatoUsuario SET Valor = 'ss' WHERE CdContatoUsuario = 13

deu essa mensagem e altera com sucesso

(1 row(s) affected)

da um response.write na sql e ve o que ela escreve...

Link to comment
Share on other sites

  • 0

Sim

SQL = "UPDATE ContatoUsuario SET Valor = '"& strvalor &"' WHERE CdContatoUsuario = "&Request.QueryString("CdContaUsuario")

set rs = abredb.execute(SQL

e a linha 51 é esse update mesmo?

Link to comment
Share on other sites

  • 0

só que você tem que mandar imprimir a consulta, como o colega Bareta disse. não adianta você fazer direto no SQL, você precisa VER o que está saindo na consulta:

SQL = "UPDATE ContatoUsuario SET Valor = '"& strvalor &"' WHERE CdContatoUsuario = "&Request.QueryString("CdContaUsuario")
response.write SQL
response.end
set rs = abredb.execute(SQL)

Link to comment
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.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...