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")
%>
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


0