Results 1 to 2 of 2

Thread: Get data from SQL Server

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    U.S.A
    Posts
    12

    Post

    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

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    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).

    Code:
    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).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width