Flamewave, Thank you for your willingness to share your code!
I have the web page up at http://65.174.82.72/specials2.asp. There is an error message on this web page. I only want two pictures to show up on one line. I suspect that the error message is due to me having a third picture. I will copy and paste my code for you. Does anyone know how to this code to make the error message disappear? Please look at the error message on the page. The third picture showed up, but the product's name didn't show up.
Take a look at my code below.
dim rs
dim sqlString
dim connectionString, databaseName, path
dim SpecialsID, ImageName, SpecialsName
'Set connection details (No need to include the code for this)
Const NUM_COLUMNS = 2
Dim EndOfRS
Dim NumRecords, Temp1, Temp2, Temp3, i
EndOfRS = 0
NumRecords = 0
'Start sql string with Join
sqlString = "select * from Specials"
'Create a recordset
set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = 2
rs.Open sqlString, connectionString
%>
<HTML>
<HEAD>
<TITLE>Specials</TITLE>
<p>
<P>
</HEAD><BODY>
<center><table border="0" width="100%">
<%
Do While Not rs.EOF
NumRecords = NumRecords + 1
rs.MoveNext
Loop
rs.MoveFirst
Do While NOT rs.EOF %>
<tr>
<%
For i=1 to NUM_COLUMNS
%><td> <a href="ViewSpecial.asp?qryID=<%=rs("SpecialsID")%>"><img src=../Upload/<%= rs("ImageName") %> width="144" height="144" border="0" alt=<%= rs("SpecialsName")%>></a></td>
<% If rs.EOF Then
EndOfRS = 1
Exit For
End If
rs.MoveNext
Next
If EndOfRS = 0 Then
rs.Move -NUM_COLUMNS
If rs.BOF = True Then
rs.MoveFirst
End If
End If
If EndOfRS = 1 Then
rs.MoveFirst
Temp1 = InStr((NumRecords / NUM_COLUMNS), ".")
Temp2 = Left((NumRecords / NUM_COLUMNS), Temp1-1)
Temp3 = Temp2 * NUM_COLUMNS
rs.Move Temp3
End If
%>
</tr>
<tr>
<%
For i=1 to NUM_COLUMNS
%><td> <b><%= rs("SpecialsName") %></b><p><p><p></td>
<%rs.MoveNext
If rs.EOF Then Exit For
Next
%>
</tr>
<% Loop %>
</center></table>
</body>
</html>
Edited by Misty