Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2006, 05:56 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default iteration movenext

I am trying to iterate through my database to return rows to excel but i only get a single row, here is my code:

objConn.Open "Driver={SQL Server};Provider=SQLOLEDB;data source=SQLSERVER;database=DB;Uid=sa;Pwd=pwd"
stSQL = "SELECT Name FROM Id"
objRS.Open stSQL, objConn

Do While objRS.EOF = False
    ws.Cells(1, 1).Value = objRS.Fields(0).Value
    objRS.MoveNext
Loop

thanks again.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Movenext with ado.net rwalker ASP.NET 1.0 and 1.1 Professional 2 February 20th, 2010 06:21 AM
2 small problems, maybe movenext placement? aduggan Classic ASP Databases 1 April 24th, 2007 12:28 PM
iteration bostek Excel VBA 5 August 30th, 2006 01:23 AM
movenext problem durier SQL Server ASP 4 January 27th, 2006 08:04 AM
rs.movenext problem hastikeyvan Dreamweaver (all versions) 1 October 27th, 2005 10:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.