
11/02/2008, 02:45
|
| | Fecha de Ingreso: noviembre-2007
Mensajes: 471
Antigüedad: 17 años, 6 meses Puntos: 2 | |
Borrar registro buenas,
hace tiempo hicimo este codigo aqui para borrar los registro que lleven mas de un mes y funcionaba perfectamente. Pero ahora nose porque no me va bien y al ejecutarlo me borra todos los registros.
Mi codigo:
<%
fecha_tope = dateadd("d",-30,date())
set oConn = Server.Createobject("Adodb.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&Server.MapPath("registrate.mdb")&";"
strSQL = "delete from anuncio where fecha <= #"&Fecha_tope&"#"
set rs = oConn.Execute(strSQL)
rs.Close
oConn.Close
set rs = nothing
set oConn = nothing
%>
saludos |