Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560

    Variable is undefined: 'iPageSize'

    Microsoft VBScript runtime error '800a01f4'

    Variable is undefined: 'iPageSize'

    /default.asp, line 117

    riga 117: iPageSize = 2


    mi da questo errore perchè devo andare a definire tutte le variabili nel file "mdb-database/inc_variabili.asp" ?


    codice:
    <%
    	'VERSIONE FILE 1.4.0
    
    	Option Explicit
    %>
    
    <% response.buffer=true %>
    <% Server.ScriptTimeout = 300 %>
    
    
    
    
    
    
    
    <html>
    <head>
    <link rel="shortcut icon" href="/favicon.ico" />
    <link rel="stylesheet" href="include/style.css">
    <title>Portfolio e links partners</title>
    <meta name="keywords" content="<%=Motori_Keywords%>">
    <meta name="description" content="<%=Motori_Description%>">
    <META http-equiv="keywords" content="<%=Motori_Keywords%>">
    <META http-equiv="description" content="<%=Motori_Description%>">
    <meta NAME="copyright" CONTENT="">
    <meta name="ROBOTS" content="INDEX, ALL, FOLLOW"></meta>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
    <!--
    body {
    	background-image: url();
    	background-color: #FFFFFF;
    }
    .Stile1 {color: #FFFFFF}
    .Stile2 {font-size: 12px}
    .Stile3 {color: #092952}
    .Stile4 {font-size: 12px; color: #092952; }
    .Stile12 {font-size: 12px; color: #535353; }
    -->
    </style></head>
    
    <body topmargin="<%=Body_TopMargin%>" leftmargin="<%=Body_LeftMargin%>" marginwidth="<%=Body_MarginWidth%>" marginheight="<%=Body_MarginHeight%>">
    	<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
    		<tr>
    			<td colspan="5">
    			</td>
    		</tr>
    		<tr>
    			<td width="6" height="0" bgcolor="<%=TabellaBig_Colore_SxDx%>" valign="top" align="center">
    				
    
    			</td>
    			<td width="5" bgcolor="<%=TabellaBig_Colore_Cx%>">
    				
    			</td>
    			<td width="620" bgcolor="<%=TabellaBig_Colore_Cx%>" valign="top">
    				
    
    
    					
    				</p>
    				<blockquote>
    				  <p align="justify"> 
    			  </blockquote>				
    
    
    <TABLE WIDTH="500" CELLPADDING="0" CELLSPACING="0" BORDER="0" align="center">
    	<TR height="60" valign="middle">
    		<TD align="center">
    			<font face="verdana" size="3" color="red">Paginazione dei risultati di una query</font>
    		</TD>
    	<TR>
    		<TD>	
    			<%
    			iPageSize = 2 'NUMERO RECORD PER PAGINA
    
    			If Request.QueryString("page") = "" Then
    				iPageCurrent = 1
    			Else
    				iPageCurrent = CInt(Request.QueryString("page"))
    			End If
    
    			strSQL = "SELECT * FROM News ORDER BY ID ASC"
    			Set objRS = Server.CreateObject("ADODB.Recordset")
    			objRS.PageSize = iPageSize
    			objRS.CacheSize = iPageSize
    			objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
    
    			reccount = objRS.recordcount
    			iPageCount = objRS.PageCount
    
    			If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
    			If iPageCurrent < 1 Then iPageCurrent = 1
    
    			If iPageCount = 0 Then
    				Response.Write "
    
    Non sono stati trovati links.</p>"
    			Else
    				objRS.AbsolutePage = iPageCurrent
    				iRecordsShown = 0
    				%>
    				
    							<table width="480" border="1" align="center" height="119" cellpadding="3" cellspacing="1">
    							<%
    								'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
    								'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
    								cont=1
    								Do While iRecordsShown < iPageSize And Not objRS.EOF
    									Dim Rig, bg
    									Rig = Rig + 1
    									If Rig Mod 2 = 0 then
    										bg = "#E4E4E4"
    									Else
    										bg = "#ccccff"	
    									End if %>
    								<tr bgcolor="<%=Tabella_Colore_Titolo%>">
    									<td colspan="2">
    				 <% Response.Write "" & objRS("Titolo") & "" %>
    			</td>
    		</tr>
    		<tr>
    				<td width="120" align="center" valign="top">
    					<% Response.Write "[img][/img]" %> 
    				</td>
    				<td width="21000" valign="top"></td>
    				<td width="480" valign="top" colspan="2">
    				<p align="justify"><% Response.Write "" & objRS("Testo") & "" %></p>
    			</td>
    		</tr>
    		<tr>
    			<td align="center" valign="top" colspan="2">
    				<%=Errore_NoNews%>
    			</td>
    			</tr> 
    		  </table>
    		  <%
    								Cont = Cont + 1
    									'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
    									iRecordsShown = iRecordsShown + 1
    									objRS.MoveNext
    								Loop
    								'PULIZIA DEGLI OGGETTI ADO
    								objRS.Close
    								Set objRS = Nothing
    								%>
    			<%End if%>
    			<%If ipagecount <> 1 Then%>
    		  <center>
    				<table>
    					<tr valign="middle">
    						<td width="50%" align="center" valign="middle"><font face="verdana" size="1" color="#000000">
    							[
    							<%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%>
    								[img]images/first.gif[/img]
    							<%end if%>
    							<%if iPageCurrent > 1 then%>
    								[img]images/pre.gif[/img]
    							<%end if%>
    							<%if iPageCount > 2 then
    								if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2
    								if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2
    							else
    								da_pag = 1
    								fino_a_pag = iPageCount
    							end if%>
    							<%for i = da_pag to fino_a_pag%>
    								<%if i = iPageCurrent then%>
    									<font color="red"><%=i%></font>
    								<%else%>	
    									<%=i%>
    								<%end if%>	
    							<%next%>
    							<%if iPageCurrent > 0 and iPageCurrent < iPageCount then%>
    								[img]images/next.gif[/img]
    							<%end if%>	
    							<%if iPageCurrent+1 < iPageCount then%>
    								[img]images/last.gif[/img]
    							<%end if%>	
    							]
    						</font></td>
    					</tr>
    					<tr>
    						<td colspan="2" align="center"><font face="verdana" size="1" color="#000000">
    							<center>
    							Pagina
    								<font color="#FF0000"><%=iPageCurrent%></font>
    								di
    								<font color="#FF0000"><%=iPageCount%></font>
    							</center>
    						</font></td>
    					</tr>
    				</table>
    		  </center>
    			<%end if%>
    			<%
    			objConn.Close
    			Set objConn = Nothing
    			%>
    		</TD>
    	</TR>
    </TABLE>            
    				</p>
    			</td>
    			<td width="5" bgcolor="<%=TabellaBig_Colore_Cx%>">
    				
    			</td>
    			<td width="150" height="0" bgcolor="<%=TabellaBig_Colore_SxDxD%>" align="center" valign="top">
    				
    
    				
    
    				
    
    				<p align="center">
    					
    				</p>
    				<div align="center">
    
    			        </td>
    		            </tr>
    </div>
    		        <div align="left"></div>
    		        <table width="787" border="0" align="center">
                      <tr>
                        <td width="769">[img]images/bot_px.gif[/img]</td>
                      </tr>
    </table>
             
    
    </p>
    </body>
    </html>

  2. #2
    Se metti "Option Explicit" devi definire tutte le variabili che usi nella pagina e nei file inclusi.
    E va bene così... Senza parole! eeeeeeeeeeeeeeeeh

  3. #3
    visto che hai usato la direttiva

    Option Explicit

    devi dimensionare tutte le variabili che intendi usare. provvedi

  4. #4
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    ora mi da questo errore..mentre inserivo le variabili..

    ADODB.Recordset error '800a0bb9'

    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

    /default.asp, line 129

    riga 129: objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText

  5. #5
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    up

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.