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

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

    Ciao a tutti!
    Qualcuno può dirmi perchè questo script genera questo errore?

    Tipo di errore:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][Driver ODBC Microsoft Access] Errore di sintassi (operatore mancante) nell'espressione della query 'id ='.
    ../leggi_news.asp, line 14



    <%@LANGUAGE="VBSCRIPT"%>
    <html>
    <head>
    <title>Archivio News</title>

    </head>
    <body>
    <%
    'IMPOSTA LA CONNESSIONE E IL PERCORSO DEL DATABASE
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("mdb-database/database.mdb")
    Set RS = Server.CreateObject("ADODB.Recordset")
    strSQL="select * from news where id =" & request.QueryString("id") &""
    RS.Open strSQL,Conn, adOpenStatic, adLockOptimistic


    'CONTROLLA SE LA NEWS è REALMENTE PRESENTE
    if RS.eof = false then
    'VISUALIZZA LA NEWS, PRELEVANDO TUTTI I DATI DAL DATABASE
    %>


    <font face="Verdana, Arial, Helvetica, sans-serif" size="4">&gt; <%=RS("titolo")%></font><font face="Verdana, Arial, Helvetica, sans-serif" size="2">di<%=RS("autore")%>-<%=RS("data")%></font></p>


    <font face="Verdana, Arial, Helvetica, sans-serif" size="2"><%=RS("contenuto")%></font></p>


    </p>
    <%
    end if

    RS.close
    Conn.close
    Set Conn = nothing
    Set RS = nothing
    %>
    </body>
    </html>


    Forse l'errore si trova nella richiesta in SQL?
    Aiutoooooooooo!
    Grazie!
    Peppe

  2. #2
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    non arriva valorizzato id in querystring
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  3. #3
    Cosa mi consigli di fare per risolvere questo problemino?
    Peppe

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2003
    Messaggi
    591
    Se ci spieghi da dove arriverebbe il dato si può evitare di tirare ad indovinare.

  5. #5
    Da questo script:
    ...
    'IMPOSTA LA CONNESSIONE E IL PERCORSO DEL DATABASE
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("mdb-database/database.mdb")
    Set RS = Server.CreateObject("ADODB.Recordset")
    strSQL="select top 10 * from news order by id desc"
    RS.Open strSQL,Conn, adOpenStatic, adLockOptimistic

    'CONTROLLA SE SONO PRESENTI NEWS NEL DATABSE
    if RS.eof = false then
    %>
    <table border="0" cellpadding="0" cellspacing="0" width="34%">
    <%
    'VISUALIZZA LE PRIME 10 NEWS
    do until RS.eof
    %>
    <tr>
    <td width="6%" bgcolor="#C3D3DB"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">&gt;</font></td>
    <td width="6%" bgcolor="#C3D3DB"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">"><%=RS("titolo")%></font></td>
    </tr>
    <%
    RS.movenext
    loop
    %>
    </table>
    <%
    end if

    RS.close
    Conn.close
    Set Conn = nothing
    Set RS = nothing
    %>
    </body>
    </html>


    Il collegamento sul titolo della news porta alla pagina "leggi_news.asp", alla quale passo il la querystring "id", con l'Id della notizia.
    Ok!
    Peppe

  6. #6
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    è valorizzato in quesrystring id? nella prima pagina?
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

  7. #7
    Scusa ma spiegati meglio!
    Peppe

  8. #8
    Utente di HTML.it L'avatar di Sypher
    Registrato dal
    Jun 2003
    Messaggi
    1,994
    Originariamente inviato da Gp85
    Scusa ma spiegati meglio!
    se ti fermi con la freccia sopra al link oppure quando sei arrivato nella seconda pagina guardando l'URL che c'è scritto nella querystring
    La passera non dura perchè Sypher la cattura!

    "No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"

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.