Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 My code, wont display correctly...need suggestions

Author  Topic 

goingcrazy
Starting Member

6 Posts

Posted - 2003-06-25 : 19:26:01
The code gives a correct count, and displays it in XML form but my problem is it just keeps repeating it in the webbrowser in a loop.

I must be leaving something out?

Can anyone notice what I am doing wrong?

<%
response.ContentType = "text/xml"

set conn=Server.CreateObject("ADODB.Connection")
conn.open "DSN=slx"

sql="select count(userid) from sysdba.history where opportunityid ='OWST9a0001UU'"

set rs=Conn.Execute(sql)
response.write("<guestbook>")
while (not rs.EOF)
response.write("<guest>")
response.write("<username>" & rs("") & "</username>")
response.write("</guest>")
wend
conn.close()
response.write("</guestbook>")
%>

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-06-25 : 19:38:33
<edit>
I think this is an off topic discussion, not sure.
Moderators?
</edit>
Yes, I see what the problem is

 
<%
response.ContentType = "text/xml"

set conn=Server.CreateObject("ADODB.Connection")
conn.open "DSN=slx"

sql="select count(userid) from sysdba.history where opportunityid ='OWST9a0001UU'"

set rs=Conn.Execute(sql)
response.write("<guestbook>")
while (not rs.EOF)
response.write("<guest>")
response.write("<username>" & rs("") & "</username>")
response.write("</guest>")
rs.MoveNext
wend
conn.close()
response.write("</guestbook>")
%>


You never move to the next record, so it's outputting that first record until the page times out.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>

Edited by - michaelp on 06/25/2003 19:39:18
Go to Top of Page
   

- Advertisement -