Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying records through rows

Status
Not open for further replies.

zuza

Programmer
Nov 9, 2003
54
YU
hello there,

I have to display in output only first field of the table called Claimno and there are 4000 records approximately.But to loop through these normally with one column is not the point. How can it be displayed for intance:

DS002233 DS009971 DS009988 DSr....
DS004455 DS009973 DS009991 .....
DS606775 DS009976 DS009992
DS005566 DS009978 DS009993

I hope that you get my point.

Rgds,
ZuZa.
 
Thanks a lot,

I'm trying but is not even reading the part of asp for displaying on rows:

Can you please check where can the problem be?

----------------------------------
<% @language = VBScript %>
<html>
<title>
<body>
<%

strSQL = "select claimno from vewMissingClaims"
Set DB = Server.CreateObject ("ADODB.Connection")
DB.Open "dsn=link","web","bani"
Dim rs
Set rs= DB.Execute(strSQL)
%>

<TABLE border="1">
<TR>
<%
intCount = 0
If NOT RS.EOF Then
While NOT RS.EOF
intCount = intCount + 1

Response.Write "<TD>RS("claimno")</TD>"

If intCount = 3 Then
Response.Write "</TR>" & vbcrlf & "<TR>"
intCount = 0
End If

RS.MoveNext
Wend

'if the final row isnt full then fill with empty <TD> tags
Do While intCount < 3
Response.Write "<TD>&nbsp;</TD>"
intCount = intCount + 1
Loop
End If
%>
</TR>
</TABLE>


</body>
</html>
-------------------------------------------------------

Regards,
ZuZa.
 
If it isn't executing the loop you have to consider why that could be occurring. Since the only condition that has to be fulfilled in order for the loop to be executed is the inclusion of records in the recordset, then in order to skip the loop the recordset would have to be empty.
The second option is that the recordset isn't empty but that the field your prining is empty for all records and your just printing an empty table.

To figure out which case to look into, check the source in the browser after loading the page. If there are a awhole lot of tr and td tags then you have an empty column of data that your printing. If there are no tr and td tags then you need to figure out why your not getting any records back from the database for your SQL string.

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
Need an expensive ASP developer in the North Carolina area? Feel free to let me know.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top