PDA

Click to See Complete Forum and Search --> : Get data from SQL Server


judy
Dec 30th, 1999, 12:48 AM
I do not know how to solve this problem.
I want to get total 1000 records from sql Server. In the first time, I got 100 records using "Set ROWCONNT 100" statement. How can I get the next 100 records without generate a recordset that including the first 100 records that I have already got? Thanks in advance.

------------------
y

JHausmann
Dec 30th, 1999, 03:31 AM
Using a recordset and a counter (with VB5/6), it should be real easy to do what you want. Just make sure that you retrieve in the same order that you insert (make sure there's a primary key on the table).


dim SQL as String
dim ndx as Integer

'open recordset
set rs db.OpenRecordset(SQL, dbOpenSnapshot)

ndx=1
'then read data
if rs.eof = false Then
do while rs.eof = false
if ndx > 100 and nndx < 1001 then 'its not the first 100 records
'process record 101 thru 1000, 1 record at a time
end if
nndx=nndx+1
rs.movenext
loop
end if


[This message has been edited by JHausmann (edited 12-30-1999).]