Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/08/2002, 16:25
pepelucho
 
Fecha de Ingreso: enero-2002
Ubicación: Callao - Perú
Mensajes: 1.127
Antigüedad: 23 años, 4 meses
Puntos: 0
Actualizar si campo esta vacio!!!

Hola a todos, quisiera actualizar un registro solo si el campo donde lo voy a editar esta vacio sino q siga buscando el campo vacio les pongo el codigo para q lo vean mejor:
************************************
<!--#include file="setup/setup.asp" -->
<%
imagen=request.form("imagen")
noticia=request.form("noticia")
set rs=server.createobject("adodb.recordset" )
rs.activeconnection=cn
sql="select * from noticias"
rs.open sql
set rt=server.createobject("adodb.recordset" )
rt.activeconnection=cn
if rs("imagen")="" then
sql="update noticias SET imagen='"&imagen&"' where id='"&noticia&"'"
rt.open sql
rt.close
end if
if rs("imagen2")="" then
sql="update noticias set imagen2='"&imagen&"' where id='"&noticia&"'"
rt.open sql
rt.close
end if


%>
************************************


SaLuDoS dE:
PePeLuChO dEl PeRú PaRa El MuNdO ;)