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

    DataCommand1.RecordCount < Request.Form

    Con questo sript a seguire (che funzionava con SQL) non riesco a visualizzare i valori ottenendoli dal database di MySql.
    I valori dovrebbero essere numero 15 per pagina con la possibilità di procedere avanti ed indietro.
    Dove devo modificare per farlo funzionare ?

    <%@ LANGUAGE="VBSCRIPT" %>
    <%Session("Num")=""
    Tipo=Request.Form("Tipo")
    What=Request.Form("What")
    From=Request.Form("From")
    If From="" Then
    From=1
    End If

    If Len(What) < 1 Then
    response.redirect "Invalid.html"
    End If
    Set pippo = Server.CreateObject("ADODB.Connection")
    Pippo.ConnectionTimeout = Session("Pippo_ConnectionTimeout")
    Pippo.CommandTimeout = Session("Pippo_CommandTimeout")
    Pippo.Open Session("Pippo_SQLConnectionString")
    Set cmdTemp = Server.CreateObject("ADODB.Command")
    Set DataCommand1 = Server.CreateObject("ADODB.Recordset")
    cmdTemp.CommandText = "SELECT …"
    Select Case Tipo
    Case 0
    cmdTemp.CommandText = cmdTemp.CommandText & " Where tabellax.nome_campo1 Like '" & What & "%' Order By tabellax.nome_campo1"
    Case 1
    cmdTemp.CommandText = cmdTemp.CommandText & " Where nome_campo Like '" & What & "%' Order By nome_campo1"
    Case 2
    cmdTemp.CommandText = "SELECT …"
    Case 3
    cmdTemp.CommandText = "SELECT …"
    End Select
    cmdTemp.CommandType = 1
    Set cmdTemp.ActiveConnection = Pippo
    DataCommand1.Open cmdTemp, , 0, 1
    If DataCommand1.RecordCount=0 Then
    Response.Redirect "nome_fileNULL.asp"
    End If
    If DataCommand1.RecordCount=1 then
    response.redirect "nome_fileDATA.asp?Num=" & Server.URlEncode(DataCommand1("ID"))
    Else
    Session("Num")=""
    End If
    If DataCommand1.RecordCount < From + 14 Then
    Ultimo=DataCommand1.RecordCount
    Else
    Ultimo=From+14
    End If
    DataCommand1.Move From-1

    %>

    <html>


    <%For I = From To Ultimo%>
    <tr>
    <td><%=DataCommand1("nome_campo1")%>[/b]</td>
    <td><%=DataCommand1("nome_campo2")%></td>
    </tr>
    <%DataCommand1.movenext
    Next%>
    <%If From > 15 Then%>
    <td align="center">
    <form method="Post" action="nome_fileSTESSO.asp">
    <input type="hidden" name="What" value="<%=What%>">
    <input type="hidden" name="Tipo" value="<%=Tipo%>">
    <input type="hidden" name="From" value="<%=From - 15%>">
    <input type="submit" value="Precedenti">
    </form>
    </td>
    <%End If%>
    <%if Ultimo < DataCommand1.recordCount Then%>
    <td align="center">
    <form method="Post" action="nome_fileSTESSO.asp">
    <input type="hidden" name="What" value="<%=What%>">
    <input type="hidden" name="Tipo" value="<%=Tipo%>">
    <input type="hidden" name="From" value="<%=Ultimo+1%>">
    <input type="submit" value="Successivi">
    </form>
    </td>
    <%End If%>



    </html>

  2. #2

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.