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
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