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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Horizontal Looper to display SQL data - Missing Info??

Status
Not open for further replies.

dreamaz

Technical User
Dec 18, 2002
184
CA
Hi,

I am using a horizontal looper to display multiple rows/columns of info from the SQL server. I configured the looper to display the results in 20 rows and 2 columns. I only seem to get 2 rows and 2 columns returned, and the data seems to be random??

This is my select statement:

QueryDB.Source = "SELECT * FROM dbo.Inventory WHERE ProductCat = '" + Replace(QueryDB__MMColParam, "'", "''") + "'"

Somehow the database returns only 4 items? when I run a test on the recordset it works fine. Here is my ASP code..

<%
startrw = 0
endrw = HLooper1__index
numberColumns = 2
numrows = 15
while((numrows <> 0) AND (Not QueryDB.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%>
<tr align=&quot;center&quot; valign=&quot;middle&quot;>
<%
While ((startrw <= endrw) AND (Not QueryDB.EOF))
%>
<td> <img src=&quot;<%=QueryDB(&quot;ImageLoc&quot;)%>&quot; width=&quot;70&quot; height=&quot;70&quot;&quot;>
</td>
<td width=&quot;125&quot;> <div align=&quot;left&quot;><font color=&quot;#0000CC&quot; size=&quot;1&quot; face=&quot;Tahoma&quot;><%=(QueryDB.Fields(&quot;ProductType&quot;))%><strong><%=&quot;<br> Price $&quot;%><%=(QueryDB.Fields(&quot;SalePrice&quot;))%></strong></font> </div>
<td width=&quot;250&quot;><div align=&quot;left&quot;><font color=&quot;#990000&quot; face=&quot;Tahoma&quot;><strong><%=(QueryDB.Fields(&quot;ProductMake&quot;))%><%=(QueryDB.Fields(&quot;ProductDescription&quot;))%><strong> </font> </div>
<td> <%QueryDB.MoveNext%> </td>
<%
startrw = startrw + 1
QueryDB.MoveNext()
Wend

numrows=numrows-1
Wend
%>
 
This looks like your using VBScript for your ASP, yet your querystring has +'s for concatenation instead of &amp;s...?

What is a &quot;looper&quot;?

-Tarwn ________________________________________________________________________________
Sometimes it is how you ask the question: faq333-2924
Many ASP questions have already been answered, please check faq333-3048 and use the search tool before posting
 
looper?!? I'm curious to hear that one also _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
 
Sorry for mentioning earlier

Im using Dreamweaver MX. Horizontal looper is a DW extension which will display records from a recordset horizontally while moving to the next record in the next row/next column. See and check out Horizontal Looper2

I would like my records to flow from one column to the next (2 columns max) then onto the next row if needed

Any ideas?
 
are you 100% sure that this ProductCat has more then 4 items?
Change you Select statement to display all recs and see...
 
HI

Managed to figure it out... was a problem with my code. I removed the first line shown below as it was a dupe and a typo as well. THe horizontal looper works like a charm, very easy to work with. Thanks for that tip 777axa.

<td> <%QueryDB.MoveNext%> </td>
<%
startrw = startrw + 1
QueryDB.MoveNext()
Wend

numrows=numrows-1
Wend
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top