Problema con insert y bd access
Estimado dacomon, tengo una pagina asp que inserta y tambien elimina un determinado correo de mi base de datos.
el mensaje de error es el sgte :
--------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Expected query name after EXECUTE.
/email.asp, line 64
-------------------------------
la pagina web es la sgte : www.buyfromperu.com , la opcion es "dejanos tu email".
el codigo asp toma el email y verifica di esta ya ingresado mediante un select y luego hace el insert o el delete, y es el sgte :
-------------------------------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conbuy.asp" -->
<%
session("numeroc")=0
Dim mmeditq
Dim mmeditcmd
Dim mmeditc
dim mmeditr
dim mensage
dim valor1, valor2, valor3, valor4
valor1 = request.form("emailing")
valor2 = request.form("emailbor")
valor3 = request.Form("emailfec")
valor4 = request.Form("emailpais")
mmeditc = MM_conbuy_STRING
mmeditq=""
mensage=""
if valor1<>"" OR valor2<>"" then
Dim rs
if valor1<>"" then
mmeditq = "select email from emails where email = '" & CStr(valor1) & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conbuy_STRING
rs.Source = mmeditq
rs.CursorType = 3
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
if rs.recordCount=0 then
mmeditr = "emailresultado.asp"
mmeditq = "insert into emails(email,fecha,pais) values('" & CStr(valor1) & "','" & CStr(valor3) & "','" & CStr(valor4) & "')"
else
mensage="No se encontro el email especificado"
mmeditq=""
end if
rs.Close()
Set rs = Nothing
end if
if valor2<>"" then
mmeditr = "emailborrado.asp"
mmeditq = "select email from emails where email = '" & CStr(valor2) & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conbuy_STRING
rs.Source = mmeditq
rs.CursorType = 3
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
if rs.recordCount=0 then
mensage="No se encontro el email especificado"
mmeditq=""
rs.Close()
Set rs = Nothing
else
mmeditq = "delete from emails where email = '" & CStr(valor2) & "'"
end if
end if
if mmeditq<>"" then
Set mmeditcmd = Server.CreateObject("ADODB.Command")
mmeditcmd.ActiveConnection = mmeditc
mmeditcmd.CommandText = mmeditq
mmeditcmd.Execute
mmeditcmd.ActiveConnection.Close
response.redirect(mmeditr)
end if
end if
%>
-------------------------------
espero tu colaboracion , gracias
el mensaje de error es el sgte :
--------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Expected query name after EXECUTE.
/email.asp, line 64
-------------------------------
la pagina web es la sgte : www.buyfromperu.com , la opcion es "dejanos tu email".
el codigo asp toma el email y verifica di esta ya ingresado mediante un select y luego hace el insert o el delete, y es el sgte :
-------------------------------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conbuy.asp" -->
<%
session("numeroc")=0
Dim mmeditq
Dim mmeditcmd
Dim mmeditc
dim mmeditr
dim mensage
dim valor1, valor2, valor3, valor4
valor1 = request.form("emailing")
valor2 = request.form("emailbor")
valor3 = request.Form("emailfec")
valor4 = request.Form("emailpais")
mmeditc = MM_conbuy_STRING
mmeditq=""
mensage=""
if valor1<>"" OR valor2<>"" then
Dim rs
if valor1<>"" then
mmeditq = "select email from emails where email = '" & CStr(valor1) & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conbuy_STRING
rs.Source = mmeditq
rs.CursorType = 3
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
if rs.recordCount=0 then
mmeditr = "emailresultado.asp"
mmeditq = "insert into emails(email,fecha,pais) values('" & CStr(valor1) & "','" & CStr(valor3) & "','" & CStr(valor4) & "')"
else
mensage="No se encontro el email especificado"
mmeditq=""
end if
rs.Close()
Set rs = Nothing
end if
if valor2<>"" then
mmeditr = "emailborrado.asp"
mmeditq = "select email from emails where email = '" & CStr(valor2) & "'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conbuy_STRING
rs.Source = mmeditq
rs.CursorType = 3
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
if rs.recordCount=0 then
mensage="No se encontro el email especificado"
mmeditq=""
rs.Close()
Set rs = Nothing
else
mmeditq = "delete from emails where email = '" & CStr(valor2) & "'"
end if
end if
if mmeditq<>"" then
Set mmeditcmd = Server.CreateObject("ADODB.Command")
mmeditcmd.ActiveConnection = mmeditc
mmeditcmd.CommandText = mmeditq
mmeditcmd.Execute
mmeditcmd.ActiveConnection.Close
response.redirect(mmeditr)
end if
end if
%>
-------------------------------
espero tu colaboracion , gracias
Respuesta de dacomon
-1