Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Argomenti non validi....

    Salve, posto il seguente codice trovato su un sito per la paginazione dei dati contenuti in un database:
    codice:
    <%
    Set objRecordset = Server.CreateObject("ADODB.Recordset")
    strConnection = "Provider=Microsoft.Jet.Oledb.4.0;data source=" & server.mappath("mdb-database/database.mdb")
    
    CONST RECORDMAX = 10
    
    If Request.QueryString("page").Count > 0 Then
      intPageNum = CInt(Request.QueryString("page"))
    Else
      intPageNum = 1 
    End If
    With objRecordset
      .CursorType = adOpenForwardOnly
      .CursorLocation = adUseClient
      .LockType = adLockReadOnly
      .CacheSize = RECORDMAX
      .PageSize = RECORDMAX
      .Source = "SELECT * FROM archivio ORDER BY gruppo"
      .ActiveConnection = strConnection
      .Open 
      
      Set .ActiveConnection = Nothing
      intTotalPages = .PageCount
      If NOT .EOF then
       .AbsolutePage = intPageNum
        arrData = .GetRows(RECORDMAX)
        intColsTot = Ubound(arrData,1) 
        intRowsTot = Ubound(arrData,2) 
      End If
    End With
    
    objRecordset.Close:Set objRecordset = Nothing
    
    
    For i = 0 To intRowsTot
      Response.Write "
    "
      For j = 0 To intColsTot
        Response.Write " "&arrData(j, i)
      Next
    Next
    
    
    Response.Write "
    
    "
    If intPageNum > 1 Then
      Response.Write( "<-- ")
    End If
    
    
    For i = 1 to intTotalPages
      If i = intPageNum Then
        Response.Write(" "&i&"")
      Else
        Response.Write(" "&i&"")
      End If
    Next
    
    
    If intPageNum < intTotalPages Then
      Response.Write( " -->")
    End If
    
    %>
    Quando lo provo, però, mi appare il messaggio:
    ADODB.Recordset errore "800a0bb9'

    Gli argomenti non sono di tipo valido, non sono compresi nell'intervallo consentito o sono in conflitto.

    Come mai?
    Grazie

  2. #2
    Stai cercando di usare campi o valori che non hai richiamato nella query.

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 © 2025 vBulletin Solutions, Inc. All rights reserved.