
19/11/2002, 10:14
|
| | Fecha de Ingreso: enero-2002 Ubicación: Callao - Perú
Mensajes: 1.127
Antigüedad: 23 años, 4 meses Puntos: 0 | |
Ayuda con este código Holas a todos, tengo este codigo que graba un dato en un campo si esta vacio sino pasa al otro campo hasta q encuentre uno vacio pero no se porq no graba, los campos estan vacios y las variables si pasan hasta este codigo.Porfa chequeenlo y diganme en que estoy fallando.Aquí el código:
------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
set cn=server.CreateObject("adodb.connection")
cn.open "dsn=conexion"
imagen=request.form("cad")
noticia=session("right")
Function Llenar(imagen,noticia)
set rs=server.createobject("adodb.recordset")
rs.activeconnection=cn
sql="select * from datos where id=" & noticia
rs.open sql
set rt=server.createobject("adodb.recordset")
rt.activeconnection=cn
if isnull(rs.fields("imagen1")) then
sq="update datos SET imagen1='"&imagen&"' where id=" & noticia
rt.open sq
Exit Function
end if
if isnull(rs.fields("imagen2")) then
sq="update datos set imagen2='"&imagen&"' where id=" & noticia
rt.open sq
exit Function
end if
if isnull(rs.fields("imagen3")) then
sq="update datos set imagen3='"&imagen&"' where id=" & noticia
rt.open sq
set rt=nothing
Exit Function
end if
if isnull(rs.fields("imagen4")) then
sq="update datos set imagen4='"&imagen&"' where id=" & noticia
rt.open sq
Exit Function
end if
set rs=nothing
set llenar=nothing
End Function
Llenar imagen,noticia
%>
------------------------------------------------------------
__________________ SaLuDoS dE:
PePeLuChO dEl PeRú PaRa El MuNdO |