Discussion:
Problemas con el recordset -1
(demasiado antiguo para responder)
!00000
2007-10-21 14:24:03 UTC
Permalink
No hay manera siempre me sale el recordcount a -1 aún recorriendo todo el
recorset (lo cual no es muy profesional), y tambien poniendo movefirst y
luego movelast....
supong que sera por las propiedades: adOpenForwardOnly, adLockReadOnly pero
entonces como soluciono el problema del recordcount
-------------------------------------------------------
Dim rsLista1 As ADODB.Recordset
Dim lngCuantosLista1 As Long
Dim strLista1 As String
Set rsLista1 = New ADODB.Recordset
rsLista1.Open "Paises4OrdenadosConImagenes",
CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
If Not (rsLista1.EOF And rsLista1.BOF) Then
rsLista1.MoveFirst
'rsLista1.MoveLast
Do
Debug.Print rsLista1.Fields("NombreEspanol")
rsLista1.MoveNext
Loop While rsLista1.EOF = False
lngCuantosLista1 = rsLista1.RecordCount
Debug.Print "lngCuantosLista1: " & lngCuantosLista1
Else
Debug.Print "NO TENGO NADA EN RSLISTA1"
End If

-------------------------------------------------------
Gracias a ***@s por las molestias
Morgan
2007-10-22 05:14:52 UTC
Permalink
Usa el cursor del lado del cliente.
rsLista1.CursorLocation = adUseClient

Si aun asi no funciona, checa el siguiente link con lo que se ha discutido
antes

http://tinyurl.com/24ujfb
--
Saludos ... Morgan 8-)
DGPPTB ... Cancún, Quintana Roo, México
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by !00000
No hay manera siempre me sale el recordcount a -1 aún recorriendo todo el
recorset (lo cual no es muy profesional), y tambien poniendo movefirst y
luego movelast....
supong que sera por las propiedades: adOpenForwardOnly, adLockReadOnly pero
entonces como soluciono el problema del recordcount
-------------------------------------------------------
Dim rsLista1 As ADODB.Recordset
Dim lngCuantosLista1 As Long
Dim strLista1 As String
Set rsLista1 = New ADODB.Recordset
rsLista1.Open "Paises4OrdenadosConImagenes",
CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
If Not (rsLista1.EOF And rsLista1.BOF) Then
rsLista1.MoveFirst
'rsLista1.MoveLast
Do
Debug.Print rsLista1.Fields("NombreEspanol")
rsLista1.MoveNext
Loop While rsLista1.EOF = False
lngCuantosLista1 = rsLista1.RecordCount
Debug.Print "lngCuantosLista1: " & lngCuantosLista1
Else
Debug.Print "NO TENGO NADA EN RSLISTA1"
End If
-------------------------------------------------------
Loading...