Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Finding the end of a recordset

Discussion in 'Information Technology' started by CLamar, Jul 28, 2006.

  1. CLamar

    Expand Collapse

    How do you find the end of a recordset, so it can be used in a loop. I tried
    the EOF command but it wont enter the loop when i use it. Here is an example
    of the code. The second for loop with the * is the one giving me problems

    Set Recordset = New ADODB.Recordset
    With Recordset
    Src = "SELECT * FROM Table1"
    .Open Source:=Src, ActiveConnection:=Connection

    For Col = 0 To Recordset.Fields.Count - 1
    Sheets("DataTable").Range("A1").Offset(0, Col).Value =

    Sheets("DataTable").Range("A1").Offset(1, 0).CopyFromRecordset

    ** For Row = 2 To Recordset.EOF
    Sheets("DataTable").Cells(Row, 1)
    Next Row
    End With

  2. Loading...

    Similar Threads Forum Date
    Legal Finding the balance. Gender and judging in India's Appellate Court Breaking News Nov 7, 2010
    The Salmon Story, Finding Home Sikh Sikhi Sikhism Jul 29, 2016
    Sikhi Guru Nanak's Methodology Of Finding Truth Sikh Sikhi Sikhism Jan 1, 2016
    Movies Ashdoc's movie review---Finding Fanny ( English version ) Theatre, Movies & Cinema Sep 15, 2014
    S Asia Sikh Girls in Afghanistan Face Difficulty in Finding Mr. Right Breaking News Jul 31, 2013

  3. Arthur

    Expand Collapse

    >** For Row = 2 To Recordset.EOF

    use this instead
    For Row = 2 To Recordset.RecordCount -1

Share This Page