I am having a problem with my recordset starting with a middle record instead of the first record. I'm trying to go through each record in the recordset to get values for a few arrays in my vbscript code. My DB table has the following form:
BS_STP_NUM | LAT | LON
1 | -84 | 39
2 | -85 | 40
. . .
. . .
. . .
Here is my vbscript code
I put the "MoveFirst" command in before the "Do While", but it didn't seem to solve the problem.
Some sample output I'm getting:
stopNum(1) = 5 <--(this should be 1, not 5)
Please Help!
BS_STP_NUM | LAT | LON
1 | -84 | 39
2 | -85 | 40
. . .
. . .
. . .
Here is my vbscript code
Code:
sSQL3 = "SELECT * FROM BUS_STOP"
Set objRS2 = Nothing
Set objRS2 = CreateObject("ADODB.Recordset")
objRS2.Open sSQL3, db
counter = 0
objRS2.MoveFirst
Do While Not objRS2.EOF
counter = counter + 1
stopNum(counter) = objRS2("BS_STP_NUM")
stopLat(counter) = objRS2("LAT")
stopLon(counter) = objRS2("LON")
objRS2.MoveNext
Loop
objRS2.close
Set objRS2 = Nothing
I put the "MoveFirst" command in before the "Do While", but it didn't seem to solve the problem.
Some sample output I'm getting:
stopNum(1) = 5 <--(this should be 1, not 5)
Please Help!