Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/02/2008, 04:31
Blashak
 
Fecha de Ingreso: noviembre-2007
Mensajes: 471
Antigüedad: 17 años, 6 meses
Puntos: 2
Re: Borrar registro

mira rene_bustos el problema era poque tenia mal el codigo al borrar los registros mediante las fechas junto con las iamgenes por eso te pregunte como se hace para juntar el codigo ese que tengo de borrar la fecha un mes antes junto con el de borrar las imagenes de la carpeta.
tendria que se asi no?

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

imagenes = "select * from anuncio where fecha <= #"&Fecha_tope&"#""


set resultado = com.execute (imagenes)
do while not resultado.EOF
foto = rs("Imagen")
foto2 = rs("Imagen2")
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.GetFile(Server.MapPath("../web/imagenes/"& foto))
oFile.Delete
Set oFile1 = oFSO.GetFile(Server.MapPath("../web/imagenes/"& foto2))
oFile1.Delete
rs.movenext
loop

%>

pero asi no me funciona