Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/01/2006, 17:23
Avatar de a n g e l u s
a n g e l u s
 
Fecha de Ingreso: enero-2006
Ubicación: Chile
Mensajes: 237
Antigüedad: 19 años, 3 meses
Puntos: 1
CON ESTO PUEDES CREAR UN LOG, Y TE DA LAS BASES PARA ENVIAR POR CORREO SI QUIERES AGREGANDOLE LA OPCION DE ENVIO (EN EL FORO VI UNA REGUENA BUSCALA)

ESTA CONSULTA TE VA A DAR UN ERROR:

sql = "select * from tabla where"
on error resume next
set rs = db.execute(sql)

if err <> 0 then
dim elerror
elerror = err.description
manejoerrores(sql,elerror)
response.write elerror
response.end
else
ejecucion del codigo
end if

function manejoerrores(sql,elerror)

'creamos el textstream del archivo
archivo = request.serverVariables("APPL_PHYSICAL_PATH") & "log\log.txt"

set confile = createObject("scripting.filesystemobject")
set fich = confile.CreateTextFile(archivo)

'escribo en el archivo
fich.WriteLine(now())
fich.WriteLine("SQL"&chr(9)&": "&sql)
fich.WriteLine("ERROR"&chr(9)&": "&elerror)
fich.WriteLine("--------------------------------------------------------")

'cerramos el fichero
fich.close()
end function
__________________
Atte,
A n g e l u s
Concepción - Chile
más vale respuestas bien pensadas, que 7000 post