Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/09/2004, 12:04
oblacionx
 
Fecha de Ingreso: septiembre-2004
Mensajes: 91
Antigüedad: 20 años, 4 meses
Puntos: 0
Exclamación Problemas EOF o BOF ?????????????

Tengo el siguiente problema necesito, hacer una subconsulta, pero como al hacerlo me salia el valor de BOF o EOF es True, el registro actual se elimino, la operacion solicitada requiere un registro actual, para lo cual separe en dos consultas, para conseguir primero la fecha y pasarla luegoa una 2da consulta, pero me sale el mismo error, les agradecere su ayuda, aqui les anexo el codigo antes descrito

Dim rsProducto As New ADODB.Recordset
Dim rsFecha As New ADODB.Recordset
Dim intCantidad As Integer
Dim dtFecha As Date

With rsFecha
.ActiveConnection = cn
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.Source = "SELECT MAX(FecLot) as FECHA FROM Lote WHERE CodPro='" & txtCodPro.Text & "'"
.Open
End With

If IsNull(rsFecha!Fecha) = True Then
dtFecha = Date
Else
dtFecha = rsFecha!Fecha
End If
rsFecha.Close
Set rsFecha = Nothing

With rsProducto
.ActiveConnection = cn
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.Source = "SELECT CanProRes as CANTIDAD FROM Lote WHERE CodPro='" & txtCodPro.Text & "' AND FecLot=" & dtFecha
.Open
End With

If IsNull(rsProducto!Cantidad) = True Then
intCantidad = 0
Else
intCantidad = rsProducto!Cantidad
End If

lblCantidadTotal.Caption = intCantidad + CInt(txtCantidadLote.Text)