Juan Miguel08 de Septiembre del 2003
PreguntaAlguien me puede mirar este codigo por favor.
Creo que tengo mal la sintaxix en la linea strSQL " INSERT INTO... " porqu siempre me da un error del tipo "No coinciden los tipos de datos en la expresión de criterios."
CODIGO:
<HTML><HEAD>
<TITLE>Ejemplo 20 ASP Añadir visita</TITLE>
</HEAD>
<BODY BGCOLOR=#0055AA LINK=#AAAA00 VLINK=#AAAA00>
<FONT FACE=Verdana SIZE=5 COLOR=YELLOW><B></B>
<CENTER> PRESUPUESTO </CENTER>
</FONT><BR>
<BR>
<font color=WHITE>
<% Dim placa, pprecio
placa = Request.Form("placa")
pprecio = Request.Form("cpu")
%>
<%
On Error Resume Next
Set Conexion = CreateObject ("ADODB.Connection")
Conexion.Open "pdaplus"
strSQL ="SELECT Id FROM Pedidos ORDER BY 1 DESC"
Set miConexion = Conexion.Execute(strSQL)
Dim Id
If Not miConexion.EOF Then
Id = miConexion("Id")
Id = Id + 1
Else
Id = 1
End If
strSQL = "INSERT INTO Pedidos VALUES ('Id' , 'placa', ' pprecio')"
Set miConexion = Conexion.Execute(strSQL)
If Err.Description <> "" then
Response.Write "<B>Error en Base de Datos: " & Err.Description & "</B>"
Else
Response.Write("<P><FONT FACE=Verdana SIZE=2 COLOR=#FFFFDD><B>Se han actualizado los siguientes datos:</B></FONT></P>")
Response.Write ("<P><FONT FACE=Verdana SIZE=2 COLOR=FFFFFF><B>Nombre: " & placa1 & "<BR>E-mail: " & cpu1 & "<BR>Página Web: " & pprecio1 & "<BR>País: " & Pais & "<BR>Comentario: " & Comentario & "</FONT>")
End If
miConexion.Close
Conexion.Close
Set miConexion = Nothing
Set Conexion = Nothing
%>
</font>
</body>
</html>
Creo que tengo mal la sintaxix en la linea strSQL " INSERT INTO... " porqu siempre me da un error del tipo "No coinciden los tipos de datos en la expresión de criterios."
CODIGO:
<HTML><HEAD>
<TITLE>Ejemplo 20 ASP Añadir visita</TITLE>
</HEAD>
<BODY BGCOLOR=#0055AA LINK=#AAAA00 VLINK=#AAAA00>
<FONT FACE=Verdana SIZE=5 COLOR=YELLOW><B></B>
<CENTER> PRESUPUESTO </CENTER>
</FONT><BR>
<BR>
<font color=WHITE>
<% Dim placa, pprecio
placa = Request.Form("placa")
pprecio = Request.Form("cpu")
%>
<%
On Error Resume Next
Set Conexion = CreateObject ("ADODB.Connection")
Conexion.Open "pdaplus"
strSQL ="SELECT Id FROM Pedidos ORDER BY 1 DESC"
Set miConexion = Conexion.Execute(strSQL)
Dim Id
If Not miConexion.EOF Then
Id = miConexion("Id")
Id = Id + 1
Else
Id = 1
End If
strSQL = "INSERT INTO Pedidos VALUES ('Id' , 'placa', ' pprecio')"
Set miConexion = Conexion.Execute(strSQL)
If Err.Description <> "" then
Response.Write "<B>Error en Base de Datos: " & Err.Description & "</B>"
Else
Response.Write("<P><FONT FACE=Verdana SIZE=2 COLOR=#FFFFDD><B>Se han actualizado los siguientes datos:</B></FONT></P>")
Response.Write ("<P><FONT FACE=Verdana SIZE=2 COLOR=FFFFFF><B>Nombre: " & placa1 & "<BR>E-mail: " & cpu1 & "<BR>Página Web: " & pprecio1 & "<BR>País: " & Pais & "<BR>Comentario: " & Comentario & "</FONT>")
End If
miConexion.Close
Conexion.Close
Set miConexion = Nothing
Set Conexion = Nothing
%>
</font>
</body>
</html>
