Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 14
  1. #1

    Errore di run-time di Microsoft VBScript (0x800A01A8)

    ciao sto creando un pagina in asp solo che mi da un errore strano

    Tipo di errore:
    Errore di run-time di Microsoft VBScript (0x800A01A8)
    Necessario oggetto: 'conn'
    /nuovacartella/guestbook.asp, line 30

    sapete spiegarmi come posso fare per rimediare a quest'errore?

    vi posto il codice della pagina

    <html>

    <head>
    <title>MIO GUESTBOOK</title>
    </head>

    <body>
    <p align="center"><font size="4" face="Verdana">Messaggi_GuestBook</font></p>


    <%
    'NUMERO DI MESSAGGI PER PAGINA
    iPageSize = 5

    If Request.QueryString("page") = "" Then
    iPageCurrent = 1
    Else
    iPageCurrent = CInt(Request.QueryString("page"))
    End If
    If Request.QueryString("order") = "" Then
    strOrderBy = "id"
    Else
    strOrderBy = Request.QueryString("order")
    End If

    'PERCORSO DEL DATABASE
    url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/database.mdb")

    SetConn = Server.CreateObject("ADODB.Connection")
    conn.Open url_DB

    Set RS = Server.CreateObject("ADODB.Recordset")

    'FA LA RICHESTA AL DATABASE
    sql = "SELECT * FROM GuestBook_Messaggi ORDER BY " & strOrderBy & " DESC;"

    RS.Open sql, conn.adOpenKeyset
    RS.PageSize

    RS.CacheSize = iPageSize

    iPageCount = RS.PageCount
    If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
    If iPageCurrent < 1 Then iPageCurrent = 1

    'NESSUN MESSAGGIO INSERITO -> VIENE VISUALIZZATO UN MESSAGGIO CHE INFORMA CHE NON E' PRESENTE
    'NEMMENO UN MESSAGGIO NEL GUESTBOOK
    If iPageCount = 0 Then
    %><hr>
    <p align="center"><font size="2" face="Verdana">Nessunmessaggio inserito nel guestbook!</font></p>
    <hr>
    <%
    Else

    RS.AbsolutePage = iPageCurrent
    iRecordsShown = 0

    ' SE I MASSAGGI SONO PRESENTI NEL GUESTBOOK, LI MOSTRA

    Do While eRecordsShown < iPageSize And Not RS.EOF%>
    <hr>
    <table border="0" cellpadding="0" cellspacing="0" width="64%">
    <tr>
    <td width="28%"><font face="Verdana" size="2">Titolo commento:</font></td>

    <td width="72%"><font face="Verdana" size"2"><%RS("titolo")%></font></td>
    </tr>
    <tr>
    <td width="28%"><font face="Verdana" size="2">Commento:</font></td>
    <td width="72%"><font face="Verdana" size="2"><%=RS("messaggio")%></font></td>
    </tr>
    <tr>
    <td width="28%"><font face="Verdana" size="2">Autore:</font></td>
    <td width="72%"><font face="Verdana" size="2">"><%=RS("autore")%></font></td>
    </tr>
    <tr>

    <td width="28%"><font face="Verdana" size="2">Data inserimento:</font></td>
    <td width="72%"><font face="Verdana" size="2"><%=RS("data")%></font></td>
    </tr>
    </table>
    <hr>

    <%
    ' COMPLETA LA VISUALIZZAZIONE DEI MESSAGGI E CHIUDE LA CONNESSIONE
    ' AL DATABASE

    iRecordsShown = iRecordsShown + 1
    RS.MoveNext
    Loop
    End If
    RS.Close
    Set RS = Nothing
    Conn.Close
    %><center>
    <%
    'MOSTRA IL NUMERO DELLE PAGINE,
    'DATO CHE VERRANO MOSTRATI
    'IN QUESTO ESEMPIO 5 MESSAGGI PER PAGINA

    For x=1 to iPageCount
    %>
    <font face="Verdana" size="2">[ <%=x%> ]</font>
    <%
    next
    %>

    <p align="center"><font size="2" face="Verdana">Inserisci messaggio</font></p>

    </body>
    </html>

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    La linea 30?

    RS.Open sql, conn,adOpenKeyset


    Roby

  3. #3
    cosa devo fare? cancellarla?

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Non vedi che è diversa dalla tua?

    Roby

  5. #5
    si scusa nn avevo fatto caso

    un'altra cosa io usavo il server di prova di windows, solo che ora nonva (non capisco come mai), sapresti dirmi un server dove posso provare se funziona tutto bene?

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Cos'è il server di prova di windows?

    Roby

  7. #7
    l'IIS, per provare i file te cosa fai?

    ma la roga che mi hai postato la devo mettere a posta della riga 30 conn.Open url_DB

    o della 37 RS.Open sql, conn.adOpenKeyset

  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    conn. è errato.

    Perché sul server non c'è sempre IIS?

    Roby

  9. #9
    mi potresti dire allora cosa posso usare per provare i file?

  10. #10
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Io non ti capisco. Se un po' ermetico...
    Cosa ti serve? Le pagine ASP devi testarle in locale con IIS. Punto.

    Roby

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.