ASP looping question

J

JP SIngh

I have the following code using which I am writing to a text file.

The select statement returns 3 records and I can see that from the
response.write statement but when it writes to the file it only writes the
top 2 records. It is missing the last record.

The output on the screen is

mac address = 0050.14a2.139e vlan = Vlan202
mac address = 0050.14a2.13ff vlan = Vlan250
mac address = 0010.a41b.036c vlan = Vlan250

but the output in the text file is (you can see the last record in the
recordset is missing.)

address 0050.14a2.139e vlan-name Vlan202
address 0050.14a2.13ff vlan-name Vlan250

Does anyone know why?


SQL = "Select macaddress, vlan FROM macmap where status = 'Live' or status =
'Approved' ORDER BY id"
SET RS = conn.Execute(SQL)
Do Until NOT RS.EOF
straddress = rs("macaddress")
strvlan = rs("vlan")
response.write " mac address = " & straddress & " vlan = " & strVlan &
"<br>"
TSO.write "address " & straddress & " vlan-name " & strvlan & vbcrlf
RS.MoveNext
Loop
RS.Close
Set RS = NOTHING
conn.close
set conn = nothing
 
J

JP SIngh

Just a quick follow up I have noticed that it does not matter how many
records it returns it always writes only 2 records out to the file.
 
J

JP SIngh

My applogies everyone that was a daft question ;)

I was writing to a different file and viewing a totally different one

sorry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top