marcos_804 Postado Novembro 13, 2004 Denunciar Share Postado Novembro 13, 2004 AQUI VAI MEU CODIGO, OU MELHOR, O QUE TENTEI ADAPTAR PARA O MEU SITE <% Option Explicit %><% Response.Buffer = True %><%'Dimension variablesDim adoCon 'Database Connection VariableDim rsLivro 'Database Recordset VariableDim strCon 'Holds the Database driver and the path and name of the databaseDim strAccessDB 'Holds the Access Database NameDim strSQL 'Database query sringDim strPreviousPollQuestion 'Holds the previous Weekly Poll QuestionsDim intPreviousPollQuestionID 'Holds the previous weekly poll questions Id NumberDim dtmPreviousPollQuestionDate 'Holds the date the previous weekly poll is fromDim intRecordPositionPageNum 'Holds the record position of the previous Poll Titles to displayDim intRecordLoopCounter 'Loop counter for displaying the previous polling questions'Declare constants' ------------- Change the following line to the number of previous Poll Question Titles you wish to have displayed on each page -------Const intRecordsPerPage = 2 'Change this number to the number of previous Poll Question Titles to be displayed on each page'----------------------------------------------------------------------------------------------------------------------------------------------'Read in the previous poll question titles to display from the database'If there is no previous titles to display from then start at the last question titles in the databaseIf Request.QueryString("PaginaAtual") = "" Then intRecordPositionPageNum = 1'Else the page has been displayed before so the previous Poll Question Titles record postion is set to the Record Position numberElse intRecordPositionPageNum = CInt(Request.QueryString("PaginaAtual"))End If %><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Teste de Paginação do livro de visitas</title><style>a{text-decoration:none;font-family:verdana;font-weight:bold}a:hover{text-decoration:underline;font-weight:normal}</style><!-- The Surf-Net Weekly Poll is written and produced by Bruce Corkhill 2001 If you want your own Weekly Poll then goto http://www.surf-net.co.uk --> </head><body bgcolor="#336699" text="#FFFFFF" link="#66CCFF" vlink="#66CCFF" alink="#FF0000"><div align="center"> <table width="370" border="0" cellspacing="0" cellpadding="1"> <%'Initialise the strAccessDB variable with the name of the Access DatabasestrAccessDB = "banco"'Create a connection odjectSet adoCon = Server.CreateObject("ADODB.Connection")Set rsLivro = Server.CreateObject("ADODB.Recordset") 'Open connection to the database driverstrCon="DRIVER={Microsoft Access Driver (*.mdb)};" 'Open Connection to databasestrCon = strCon & "DBQ=" & Server.MapPath(strAccessDB)'Initalise the strSQL variable with an SQL statement to query the databasestrSQL = "SELECT * FROM livro ORDER By id DESC"'Query the databasersLivro.Open strSQL, strCon, 3'Set the number of previous Poll Question Titles to display on each page by the constant set at the top of the scriptrsLivro.PageSize = intRecordsPerPage'Get the previous Weekly Poll Titles record poistion to display fromIf NOT rsLivro.EOF Then rsLivro.AbsolutePage = intRecordPositionPageNum' loop through the previous poll questions in the database and display HTML hyperlinks to themFor intRecordLoopCounter = 1 to intRecordsPerPage 'If there are no more previous Poll Question records left to display then exit loop If rsLivro.EOF Then Exit For 'Read in the date the poll is from email = rsLivro("email") mensagem = rsLivro("mensagem") 'Write the HTML to display links to all the previous Poll Question Titles Response.Write vbCrLf & " <tr>" Response.Write vbCrLf & " <td width=""250"">Nome: <br><br>E-mail:" & email & "<br><br>Mensagem:<br>" & mensagem & "</td>" Response.Write vbCrLf & " </tr>" 'Move to the next record rsLivro.MoveNextNext %> </table> <br> <!-- Table to display next and previous links for other previous weekly poll questions --> <table width="370" border="0" cellspacing="1" cellpadding="1" align="center" height="21"> <tr align="center"> <td align="left" width="83"> <% 'If the previous Poll Question Titles page number is higher than page 1 then display a back link If intRecordPositionPageNum > 1 Then Response.Write " <a href=""testeDePaginacao.asp?PaginaAtual=" & intRecordPositionPageNum - 1 & """ target=""_self""><< Prev</a>" End If %> </td> <td width="201"> <% 'If there are more previous Poll Question Titles to display then add a title to the other pagesIf intRecordPositionPageNum > 1 or NOT rsLivro.EOF Then Response.Write " Anterior do livro"End If %> </td> <td align="right" width="76"> <% 'If it is Not the End of the previous Poll Question Titles entries then display a next link for the next previous Poll Question Titles page If NOT rsLivro.EOF then Response.Write " <a href=""testeDePaginacao.asp?PaginaAtual=" & intRecordPositionPageNum + 1 & """ target=""_self"">Next >></a>" End If 'Reset Server ObjectsSet adoCon = NothingrsLivro.CloseSet rsLivro = Nothing %> </td> </tr> </table> <br> <a href="JavaScript:window.close()">Fechar esta janela</a><br> <br></div></body></html>E ESTE É O MALDITO ERROMicrosoft VBScript runtime error '800a01f4' Variable is undefined: 'email' /teajudo/S TESTES/testeDePaginacao.asp, line 88 AJUDEM!!!!!!! Link para o comentário Compartilhar em outros sites More sharing options...
0 Rapper Postado Novembro 13, 2004 Denunciar Share Postado Novembro 13, 2004 eu acho que você tem que declara a variavel emailDim email Link para o comentário Compartilhar em outros sites More sharing options...
0 marcos_804 Postado Novembro 13, 2004 Autor Denunciar Share Postado Novembro 13, 2004 Bem, era isso mesmo. Valeu a "BIG-LUZ" que você me deu! Link para o comentário Compartilhar em outros sites More sharing options...
0 cyberalexxx Postado Novembro 13, 2004 Denunciar Share Postado Novembro 13, 2004 beleza!! Só pra explicar:Sempre que voce colocar em seu script a instrução:<% Option Explicit %>é obrigatório declarar todas as variaveis a serem usadas.Tópico Fechado!!! Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
marcos_804
AQUI VAI MEU CODIGO, OU MELHOR, O QUE TENTEI ADAPTAR PARA O MEU SITE
E ESTE É O MALDITO ERRO
AJUDEM!!!!!!!
Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados