
31/10/2003, 08:57
|
| | Fecha de Ingreso: marzo-2003 Ubicación: onde toy?
Mensajes: 1.437
Antigüedad: 22 años, 2 meses Puntos: 9 | |
Pequeño problema Señores tengo lo siguiente
Código
<%
Set Mi_Conexion = Server.CreateObject("ADODB.Connection")
Set Res = Server.CreateObject("ADODB.Recordset")
Mi_Conexion.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\horas\horas.mdb;"
sql = "SELECT * FROM actividades Where usuario = '"&usuario&"' and año = '"&anno&"' and mes = '"&mes&"' and dia = '"&dia&"' order by hora ASC;"
Res.PageSize = 10
Res.Open sql, Mi_Conexion, 1
If Not Res.Eof Then
Res.AbsolutePage = CLng(Session("Pag_Pro"))
Else
Session("Pag_Pro") = 0
End If
dim n
for n = 1 to Res.PageSize
if Not Res.EOF then%>
<tr>
<%
solicita = res("solicita")
actividad = res("actividad")
glosa = res("glosa")
hora = res("hora")
estado = res("estado")
%>
<td width="10%" align="center" class="horas"><% if (estado = "Nueva") then %>
<img src = "newanim.gif">
<% end if%>
<td width="10%" align="center" class="horas"><%response.write(hora)%></td>
<td width="18%" align="lefth" class="horas"><A class ="horas" HREF="detalleactividad.asp?usuario=<%=usuario%>&di a=<%=dia%>&month=<%=mes%>&year=<%=ano%>&hora=<%=ho ra%>"><%response.write(actividad)%></a></td>
<td width="30%" align="lefth" class="horas"><% Set conexion = Server.CreateObject("ADODB.Connection")
Set Rec = Server.CreateObject("ADODB.Recordset")
conexion.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\horas\horas.mdb;"
sql = "SELECT * FROM paciente Where rut = '"&solicita&"';"
set rec = Mi_Conexion.Execute(sql)
if not res.eof then
nombre = rec("nombres")
apellP = rec("apellidoPaterno")
apellM = rec("apellidoMaterno")
response.write(nombre)
response.write(" ")
response.write(apellP)
response.write(" ")
response.write(apellM)
If Not Rec.Eof then
Rec.MoveNext
End If
end if
rec.Close
Set Rec = Nothing
conexion.Close
Set conexion = Nothing %></td>
<td width="32%" align="lefth" class="horas"><%response.write(glosa)%></td>
</tr>
<%
If Not Res.Eof then
Res.MoveNext
End If
end if
Next
%>
</table>
<table width="342" align="center" cellpadding="2" cellspacing="2">
<tr>
<td height="1" width="56" align="Center" valign="bottom" class="horas">
<%If CLng(Session("Pag_Pro")) < Res.PageCount Then%>
<a class = "horas" href="visoractividades.asp?Mueve_Pro=Adelante&year =<%=anno%>&month=<%=mes%>&dia=<%=dia%>"> Siguiente</a>
<%Else%>
Siguiente
<%End If%>
</td>
<td height="1" width="58" align="Center" valign="bottom" class="horas">
<%If Res.PageCount > 0 Then%>
<a class ="horas" href="visoractividades.asp?Mueve_Pro=Primera&year= <%=anno%>&month=<%=mes%>&dia=<%=dia%>"> Primera</a>
<%Else%>
Primera
<%End If%>
</td>
<td height="1" width="124" align="Center" valign="top" class="horas">
<%
If Res.PageCount > 0 Then%>
<b>Página <%=Session("Pag_pro")%> de
<% = Res.PageCount%>
<%Session("UltimaPagina") = Res.PageCount%>
</b>
<%Else%>
<b = class= "letras">No Existen Actividades</b>
<%End If%>
</td>
<td height="1" width="39" align="Center" valign="bottom" class="horas">
<%If Res.PageCount > 0 Then%>
<a class= "horas" href="visoractividades.asp?Mueve_Pro=Ultima&year=< %=anno%>&mes=<%=mes%>&dia=<%=dia%>"> Ultima</a>
<%Else%>
Ultima
<%End If%>
</td>
<td height="1" width="31" align="Center" valign="bottom" class="horas">
<%If CLng(Session("Pag_Pro")) > 1 Then %>
<a class ="horas" href="visoractividades.asp?Mueve_Pro=Atras&year=<% =anno%>&mes=<%=mes%>&dia=<%=dia%>"> Atras</a>
<%Else%>
Atras
<%End If%>
</td>
</tr>
</table>
<%
Res.Close
Set Res = Nothing
Mi_Conexion.Close
Set Mi_Conexion = Nothing
%>
Pero me tira el siguiente error
08:30 Consulta Francisco Chávez Gutierrez nada
09:00 Consulta Francisco Chávez Gutierrez nada
09:30 Consulta Francisco Chávez Gutierrez nada 10:00 Consulta ADODB.Field error '800a0bcd'
El valor de BOF o EOF es True, o el actual registro ha sido eliminado; la operación solicitada por la aplicación requiere un registro actual.
/horas/visorActividades.asp, line 282
Lo que pasa es que tengo una tabla actividades con un campo llamado "solicita" el cual se actualiza con el nobre del solicitante.... pero otros quedan con ese campo sin nada...ahora bien..como rescato y actualizo con un numero de identificacion chileno.... quiero ir a la tabla Paciente y rescatar con ese numero el nombre del paciente...pero como hay registros de la tabla actividades.solicita vacios va a la tabla paciente.nombre y no encuentra nada...
Pregunta...cómo puedo evitar que me escoja aquellos registros vacios?
__________________ Buena Vida...
Francisco
Última edición por Bluesman74cl; 31/10/2003 a las 09:00 |