hughesmi
08-01-2008, 08:41 AM
I know i missing the "do" but for the life of me i cant figure the problem out. Can someone help, please.
Error
Microsoft VBScript compilation error '800a040e'
'loop' without 'do'
testpage2.asp, line 26
Loop
^
The code
<%
DIM mySQL, objRS
'mySQL = "SELECT * FROM tblData"
mySQL = "SELECT * FROM products ORDER BY pDateAdded DESC"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn
DIM recCount
IF Not objRS.EOF THEN
Response.Write "<table width='100%'>"
recCount = 0
Do UNTIL objRS.EOF
IF recCount Mod 3 = 0 THEN
IF recCount <> 0 THEN
Response.Write "</tr>"
Response.Write "<tr><td>"&objRS("pLargeImage")&"</td>"
ELSE
Response.Write "<td>"&objRS("pLargeImage")&"</td>"
END IF
recCount = recCount + 1
objRS.MoveNext
Loop
Response.Write"</tr></table>"
ELSE
Response.Write "Sorry, there are no records in our database."
END IF
%>
Error
Microsoft VBScript compilation error '800a040e'
'loop' without 'do'
testpage2.asp, line 26
Loop
^
The code
<%
DIM mySQL, objRS
'mySQL = "SELECT * FROM tblData"
mySQL = "SELECT * FROM products ORDER BY pDateAdded DESC"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn
DIM recCount
IF Not objRS.EOF THEN
Response.Write "<table width='100%'>"
recCount = 0
Do UNTIL objRS.EOF
IF recCount Mod 3 = 0 THEN
IF recCount <> 0 THEN
Response.Write "</tr>"
Response.Write "<tr><td>"&objRS("pLargeImage")&"</td>"
ELSE
Response.Write "<td>"&objRS("pLargeImage")&"</td>"
END IF
recCount = recCount + 1
objRS.MoveNext
Loop
Response.Write"</tr></table>"
ELSE
Response.Write "Sorry, there are no records in our database."
END IF
%>