Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/12/2007, 09:13
Blashak
 
Fecha de Ingreso: noviembre-2007
Mensajes: 471
Antigüedad: 17 años, 6 meses
Puntos: 2
Re: Eliminar registro automaticamente por fecha

JuanRAPerez probe con la linea esa q me pusiste y me tira este error.

Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'Fecha > = '10/12/2007''.
/web/fecha3.asp, line 24

mi codigo modificado segun vos..

<%
dim sqm
fecha_tope=dateadd("d",-30,date())

set oConn = Server.Createobject("Adodb.Connection")


oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&Server.MapPath("registrate.mdb")&";"
set resultado = oConn.execute("select * from anuncio")
do while not resultado.eof
ams=resultado("Fecha")

if ams < fecha_tope then

id=resultado("ID")
sqm = ("delete from anuncio where Fecha > = '"&fecha_tope&"'")

oConn.execute(sqm)
response.write(ams)
'response.write(id)

else
response.write("sd")
'response.write(id)
end if

resultado.movenext
loop


%>