<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Rodolfo Roth : : Designer CG</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/texto.css" rel="stylesheet" type="text/css"> <link href="css/link.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#000000"> <table width="786" height="311" border="0" align="center"> <tr> <td height="98" colspan="2"><img src="img/banner.jpg" width="780" height="96"></td> </tr> <tr> <td class="texto">:: Portfolio ::</td> <td class="texto"><div align="center">:: <a href="index.asp">Home</a> :: <a href="downloads.asp">Downloads</a> :: <a href="links.asp">Links Favoritos</a> :: <a href="mailto:rodolfo@sinos.net">Contato</a> :: <a href="ficha.asp">Ficha Técnica</a> ::</div></td> </tr> <tr> <td width="131" height="132" valign="top" class="texto"><font color="#FFFFFF"> <% DSNtemp2="DRIVER={Microsoft Access Driver (*.mdb)}; " DSNtemp2=dsntemp2 & "DBQ=" & server.mappath("db/rodolfo.mdb") sqlstmt2 = "SELECT * FROM categorias" Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.Open sqlstmt2, DSNtemp2, 3, 3 do while not rs2.eof %> <a href="portfolio.asp?port=<%=rs2("port_it")%>"> -> <%=rs2("cat")%></a><br> <% rs2.movenext %> <% loop %> </font></td> <td width="666" align="center" valign="middle"><div align="center"> <div align="center"> <span class="texto"> <% Dim Conn Dim oRS Dim sSQL Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db/rodolfo.mdb")) sqlstmt = "select * from portfolio where port_it='" & request.querystring("port") & "' ORDER BY id DESC" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sqlstmt, Conn, 1, 3 If request.querystring("PageNumber") = "" Then intPageNum = 1 Else intPageNum = CInt(request.querystring("PageNumber")) End If If RS.Eof or RS.Bof Then response.write("Nenhum registro disponível...") response.end End If ' Change you value of how many records per page here RS.PageSize = 9 %> <Font size="1"> Total: <strong><%= RS.recordcount %> </strong>arquivos - pág.: <% For i = 1 To RS.PageCount If Cint(Request.Querystring("PageNumber")) = i Then Response.Write "<a href=""portfolio.asp?port="& rs("port_it") &"&PageNumber=" & i & """>[" & i & "]</a> " Else Response.Write "<a href=""portfolio.asp?port="& rs("port_it") &"&PageNumber=" & i & """>" & i & "</a> " End If Next x = (RS.RecordCount - 9) Mod 12 %> <% RS.AbsolutePage = intPageNum For intCount = 1 To CInt(request("x")) RS.MovePrevious Next For intCount = 1 To RS.PageSize%> </font></font></span> </div> <table width="568" height="120" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="192" height="21" class="texto"> <div align="center"><%=rs("nome")%> </div></td> <td width="178" class="texto"> <div align="center"><%=rs("nome")%></div></td> <td width="194"> <div align="center" class="texto"><%=rs("nome")%></div></td> </tr> <tr> <td height="18" align="center" valign="middle" class="texto"> <div align="center"><a href="http://www.izigner.com/rodolfo/portfolio/img/<%=rs("img")%>" target="_blank"> <img src="http://www.izigner.com/rodolfo/portfolio/tumb/<%=rs("tumb")%>" width="100" border="0"></a> </div></td> <td width="178" align="center" valign="middle" class="texto"> <div align="center"> <a href="http://www.izigner.com/rodolfo/portfolio/img/<%=rs("img")%>" target="_blank"><img src="http://www.izigner.com/rodolfo/portfolio/tumb/<%=rs("tumb")%>" width="100" border="0"></a></div> <td align="center" valign="middle"> <div align="center"><a href="http://www.izigner.com/rodolfo/portfolio/img/<%=rs("img")%>" target="_blank"><img src="http://www.izigner.com/rodolfo/portfolio/tumb/<%=rs("tumb")%>" width="100" border="0"></a> </div></td> </tr> <tr> <td height="18" align="center" valign="middle" class="texto"><div align="justify"><%=rs("desc")%> <% rs.movenext %> <% if not rs.eof then%> </div></td> <td width="178" align="center" valign="middle" class="texto"> <div align="justify"><%=rs("desc")%> <% rs.movenext %> <%end if%> </div><td align="center" valign="middle"><div align="justify"><%=rs("desc")%> <% if not rs.eof then%> </div></td> </tr> <tr> <td height="20" colspan="3" class="texto"> <div align="center"> <% RS.MoveNext end if RS.Close Conn.Close
O erro acontece nesta linha:
Set RS = Nothing
O erro é este:
Erro de compilação do Microsoft VBScript erro '800a03fc' 'Next' esperado /rodolfo/portfolio.asp, line 129
Continuação do meu código:
Set Conn = Nothing %> </div></td> </tr> </table> </div></td> </tr> <tr> <td> </td> <td class="texto"><div align="center">No ar desde 2003</div></td> </tr> </table> </body> </html>
Bem.. a idéia é a seguinte:
É uma exibição de portfólio em 3 colunas e 9 registros por página.. se não tem nenhum... aparece uma msg.
Eu mesclei 2 códigos q tinha(ambos funcionam perfeitamente separados). Um, exibe a paginação, mas com ítens corridos.. naõ em colunas.
O outro, exibe em colunas, mas sem paginação.
Como faço pra ambos funcionarem juntos???
Antes tinha um "Next não sei o q" ali... mas daí o erro q aparecia é q o Next era inesperado...
------------
Outra dúvida é... como, neste mesmo script, faço pra preencher as img q faltam com uma padrão(tipo uma msg dizendo q não tem img)? Por exemplo, se a coluna é de 3, e eu tenho 4 registros.. vão sobrar 2 lugares.. e estes não possuem registros.. como preencho com imgs pradão??
Um abraço!