!00000
2007-10-21 14:24:03 UTC
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
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