Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Question Unanswered: recordcount/recordsetclone.recordcount difference

    When issuing these commands right after one another, :

    Debug.Print rstErate.GetString
    Debug.Print rstErate.RecordCount
    Debug.Print Me.RecordsetClone.RecordCount

    The result is:
    10239 1 16.12.2003 51831 0
    10239 1 16.12.2003 51832 0
    10239 1 26.12.2003 76234 0
    10239 1 26.12.2003 76244 0

    -1
    1

    (...)

    I have not used recordsetclone before, and not much of the recordcount either, so this confuses me. Why does not both counts return 4, and why are they different, -1 and 1?

    D.

  2. #2
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Arrow

    aj, had missed some lines when copying code from another part...

    First I had only:
    Dim rstErate As ADODB.Recordset
    Set rstErate = New ADODB.Recordset

    Now I have:
    Dim rstErate As ADODB.Recordset
    Set rstErate = New ADODB.Recordset
    rstErate.ActiveConnection = CurrentProject.Connection
    rstErate.CursorType = adOpenStatic
    rstErate.LockType = adLockOptimistic

    so the first count is now correctly 4, which is the method I have been using so far. But I still get only 1 on the last recordsetclone.recordcount, why is that? I have never used the clone variant before, do not know "anything" about it other than it reflects the form's underlying recordset.

    Would be interesting with some arguments for when/how to use the clone vs. the other.

    D.

Posting Permissions

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