ASP - Ayuda con actualizacion de base de datos

 
Vista:

Ayuda con actualizacion de base de datos

Publicado por Ringo (9 intervenciones) el 14/08/2006 16:55:21
Tebgo un problema para actualizar una tabla de una base de tados me marca el siguiente error
Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/cventura/Prueba/ActualizarPreguntas.asp, line 40

El resto del codigo es la siguiente:
=======================================================================
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#Include file="Conexion.asp"-->
<%
'Decalre the variables
Dim SQLUpdateEdit

'##################################################################
'Notes about the form field names and the associated database
'data types and field name
'##################################################################

'##################################################################
'For ease of the SQL insert statement place the values of the form
'into variables so we can easier identify them
'##################################################################

strNumero1 = Request.form("txtnumero1")
strPregunta1 = Request.form("txtpregunta1")

'##################################################################
'Write the SQL string to update the record
'##################################################################

SQLUpdateEdit = "UPDATE tblUsuarios SET"
SQLUpdateEdit = SQLUpdateEdit & " Numero='" & strNumero1 & "', "
SQLUpdateEdit = SQLUpdateEdit & " Pregunta='" & strPregunta1 & "', "
SQLUpdateEdit = SQLUpdateEdit & " WHERE Id_Pregunta = " & Request.QueryString("Rec") & ";"




'##################################################################
'Now tell the script to execute the SQL string on the database
'##################################################################

conn.execute SQLUpdateEdit

'##################################################################
'Tidy up any open connections and redirect the user to the main page
'##################################################################

conn.close
SET conn = Nothing
response.Redirect("MuestraPreguntas.asp")
%>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ayuda con actualizacion de base de datos

Publicado por Santos Pairazaman (415 intervenciones) el 15/08/2006 15:59:44
Sino me equivoco es errror esta aqui :

SQLUpdateEdit = SQLUpdateEdit & " WHERE Id_Pregunta = " & Request.QueryString("Rec") & ";"

db ser asi

SQLUpdateEdit = SQLUpdateEdit & " WHERE Id_Pregunta = " & Request.QueryString("Rec")

o

SQLUpdateEdit = SQLUpdateEdit & " WHERE Id_Pregunta = " & " Request.QueryString("Rec") & "

Espro sea la solución

Hasta Pronto
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar