lyric0n
Technical User
- Dec 28, 2005
- 74
When I use the following code below...how exactly is it moving through the recordset? Does it get the entire record set when I say Open, or does it get each row when I say to move next?
strcnSQL = "Provider=SQLOLEDB;Server=TEST;Database=TEST;uid=TEST;pwd=TEST"
Set cnSQL = Wscript.CreateObject("ADODB.Connection")
cnSQL.Open strcnSQL
Set rsTesting = Wscript.CreateObject("ADODB.Recordset")
strSQL = "SELECT TOP 100 PERCENT " & selectQuery &_
" FROM " & fromQuery &_
" WHERE " & whereQuery
rsTesting.Open strSQL, cnSQL, adOpenForwardOnly
rsTesting.MoveFirst
While Not(rsTesting.EOF)
msgbox(rsTesting(SomeData))
rsTesting.MoveNext
Wend
strcnSQL = "Provider=SQLOLEDB;Server=TEST;Database=TEST;uid=TEST;pwd=TEST"
Set cnSQL = Wscript.CreateObject("ADODB.Connection")
cnSQL.Open strcnSQL
Set rsTesting = Wscript.CreateObject("ADODB.Recordset")
strSQL = "SELECT TOP 100 PERCENT " & selectQuery &_
" FROM " & fromQuery &_
" WHERE " & whereQuery
rsTesting.Open strSQL, cnSQL, adOpenForwardOnly
rsTesting.MoveFirst
While Not(rsTesting.EOF)
msgbox(rsTesting(SomeData))
rsTesting.MoveNext
Wend