Handling of Fetched Records

Dim Rs as ADO.Recordset

Rs.CursorLocation = adUseServer
Rs.CursorType = adForwardOnly
Rs.LockType = adReadOnly
Rs.Cachesize = 100
Rs.Statement = "SELECT * FROM TABLE"
Rs.Open

Base on the given properties above, ADO will first fetch the
initial 100 records from the server. Using a forward only
cursor, once I reached the 100th record, it will fetch the
next 100 records. Does the previous 100 records retain
in the recordset?

Comments

  • : Dim Rs as ADO.Recordset
    :
    : Rs.CursorLocation = adUseServer
    : Rs.CursorType = adForwardOnly
    : Rs.LockType = adReadOnly
    : Rs.Cachesize = 100
    : Rs.Statement = "SELECT * FROM TABLE"
    : Rs.Open
    :
    : Base on the given properties above, ADO will first fetch the
    : initial 100 records from the server. Using a forward only
    : cursor, once I reached the 100th record, it will fetch the
    : next 100 records. Does the previous 100 records retain
    : in the recordset?
    :
    While I have never fetched records that way I would imagine No - as you are setting the cachesize to 100 - the cache is the number of records it will hold - refetching a different set of records will overwrite the current cache.

    if you want to keep the current records maybe try using 2 recordsets - one to fetch the 100 records and another to hold them, then you should beable to add more records to the recordset you are using to hold the whole batch.

    Hope it helps
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • : : Dim Rs as ADO.Recordset
    : :
    : : Rs.CursorLocation = adUseServer
    : : Rs.CursorType = adForwardOnly
    : : Rs.LockType = adReadOnly
    : : Rs.Cachesize = 100
    : : Rs.Statement = "SELECT * FROM TABLE"
    : : Rs.Open
    : :
    : : Base on the given properties above, ADO will first fetch the
    : : initial 100 records from the server. Using a forward only
    : : cursor, once I reached the 100th record, it will fetch the
    : : next 100 records. Does the previous 100 records retain
    : : in the recordset?
    : :
    : While I have never fetched records that way I would imagine No - as you are setting the cachesize to 100 - the cache is the number of records it will hold - refetching a different set of records will overwrite the current cache.
    :
    : if you want to keep the current records maybe try using 2 recordsets - one to fetch the 100 records and another to hold them, then you should beable to add more records to the recordset you are using to hold the whole batch.
    :
    : Hope it helps
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    Thanks. Just curious, how do you usually fetch records?
  • : : : Dim Rs as ADO.Recordset
    : : :
    : : : Rs.CursorLocation = adUseServer
    : : : Rs.CursorType = adForwardOnly
    : : : Rs.LockType = adReadOnly
    : : : Rs.Cachesize = 100
    : : : Rs.Statement = "SELECT * FROM TABLE"
    : : : Rs.Open
    : : :
    : : : Base on the given properties above, ADO will first fetch the
    : : : initial 100 records from the server. Using a forward only
    : : : cursor, once I reached the 100th record, it will fetch the
    : : : next 100 records. Does the previous 100 records retain
    : : : in the recordset?
    : : :
    : : While I have never fetched records that way I would imagine No - as you are setting the cachesize to 100 - the cache is the number of records it will hold - refetching a different set of records will overwrite the current cache.
    : :
    : : if you want to keep the current records maybe try using 2 recordsets - one to fetch the 100 records and another to hold them, then you should beable to add more records to the recordset you are using to hold the whole batch.
    : :
    : : Hope it helps
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : Thanks. Just curious, how do you usually fetch records?
    :


    I don't tend to fetch groups of records at a time, I just make specific querys to return the values that I need -- I've never done a program that required me to fetch sections of records personaly

    Best of luck to you, and if you need any more help don't hesitate to ask.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories