Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Aiuto Asp/flash

  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    97

    Aiuto Asp/flash

    Ciao a tutti
    come mai dalla Database mi estrapola solo 1 record?
    nel database ci sono 5 record

    AD_ID=1
    &AD_ID=148&DATA=10/07/2007&TITOLO=prova&DESCRIZIONE=prova prova prova


    ecco il codice della pagina asp
    <%
    Dim objConn
    Set objConn = Server.CreateObject("ADODB.Connectio
    n")

    ' connessione a database Access
    objConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/prova.mdb")

    dim Param
    Param = request.queryString("Param")

    dim muovi
    muovi = request.queryString("muovi")

    objConn.open

    Dim objRS, strSQL

    set objRS = Server.CreateObject("ADODB.Recordset")

    Dim operazione
    Dim stringa

    if Param <> "" then
    if muovi="successivo" then
    stringa = " where AD_ID > " + Param + " order by AD_ID ASC"
    else
    stringa = " where AD_ID < " + Param + " order by AD_ID DESC"
    end if
    else
    stringa = " order by AD_ID DESC "
    end if

    strSQL = "select * from ANNUNCIAGENZIE where POSTER='asa' " + stringa + ";"

    objRS.open strSQL, objConn, 3, 3

    Dim Totale
    Totale = objRS.RecordCount

    dim AD_ID
    AD_ID = objRS("AD_ID")

    dim DATA
    DATA = objRS("DATA")

    dim TITOLO
    TITOLO = objRS("TITOLO")

    dim DESCRIZIONE
    DESCRIZIONE = objRS("DESCRIZIONE")


    Response.Write ("AD_ID=" & AD_ID & "
    ")

    Response.write("&AD_ID=" & AD_ID & "&DATA=" & DATA & "&TITOLO=" & TITOLO & "&DESCRIZIONE=" & DESCRIZIONE )

    if Totale = 1 and muovi="precedente" then
    end if

    Response.Write (" ")

    if (Totale = 1 and muovi="successivo") or muovi="" then
    end if



    objRS.close
    set objRS = nothing

    objConn.close
    set objConn = nothing

    %>

  2. #2
    forse hai sbagliato sezione
    cmq
    una cosa del genere
    ad es x un solo campo

    Codice PHP:
    <%

    Const 
    adOpenKeyset 1
    Const adLockReadOnly 1


    %>

    <%


    ' Selezioni dalla tabella i dati 
    SQL = "SELECT * FROM tuatabella"



    Creo il RECORD SET che contiene tutti i dati selezionati dal Data base
    Set rs 
    Server.CreateObject("ADODB.RecordSet")
    rs.Open SQLconnadOpenKeyset,adLockReadOnly



    ' Eseguo un ciclo su tutti i dati del Recod set e creo il documento in output in formato leggibile da flash

    Do while not rs.eof
                                                         

    Response.Write "" & rs("TITOLO") & "&"



    rs.movenext

    Loop


    '
    aggiungo al documento il numero totale di record 
    response
    .write "tot="rs.recordcount &"&"


    rs.close
    set rs
    =nothing
    Conn
    .Close
    set conn
    =nothing

    %> 

    x la connessione
    Codice PHP:
    <%set conn=Server.CreateObject("ADODB.Connection")
    conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&_
              server
    .MapPath("mdb-database/tuodb.mdb")&";PWD="%> 
    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

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.