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
    Difficulty Finding Raag Gurmat Sangeet Tanti Saaj Nitnem Audio And Video Gurmat Sangeet Jan 13, 2017
    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

  3. OP

    Expand Collapse

    >** For Row = 2 To Recordset.EOF

    use this instead
    For Row = 2 To Recordset.RecordCount -1
Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page