J
Joao
Private Sub procLerUltDezNumInseridos()
SQLString = "SELECT TOP 10 NrSubscritor FROM Processos WHERE UserID = " _
& lngUserNumber & " ORDER BY TimeStamp DESC;"
funcCorrerSQL SQLString
End Sub
Public Function funcCorrerSQL(strCmdSQL As String)
Set rstSQL = BD.OpenRecordset( _
strCmdSQL, dbOpenDynaset)
VarTemp = 0
Registos = rstSQL.RecordCount
While Registos > 0
ObjLista.AddItem rstSQL.Fields(0), VarTemp
rstSQL.MoveNext
VarTemp = VarTemp + 1
Registos = Registos - 1
Wend
rstSQL.Close
BD.Close
end function
If I remove TOP 10 from the SQL I get all the data, if not I just get one
record.
If I run this query in Access via SQL window it works... i really just don't
understand...
SQLString = "SELECT TOP 10 NrSubscritor FROM Processos WHERE UserID = " _
& lngUserNumber & " ORDER BY TimeStamp DESC;"
funcCorrerSQL SQLString
End Sub
Public Function funcCorrerSQL(strCmdSQL As String)
Set rstSQL = BD.OpenRecordset( _
strCmdSQL, dbOpenDynaset)
VarTemp = 0
Registos = rstSQL.RecordCount
While Registos > 0
ObjLista.AddItem rstSQL.Fields(0), VarTemp
rstSQL.MoveNext
VarTemp = VarTemp + 1
Registos = Registos - 1
Wend
rstSQL.Close
BD.Close
end function
If I remove TOP 10 from the SQL I get all the data, if not I just get one
record.
If I run this query in Access via SQL window it works... i really just don't
understand...