Visualizzazione dei risultati da 1 a 10 su 10

Discussione: errore 0x800A03F9

  1. #1

    errore 0x800A03F9

    lo script è il seguente :

    <%@LANGUAGE="VBSCRIPT"%>
    <html>
    <head>
    <title>esegui_ricerca</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>



    <%

    dim myAge
    myAge = Request.Form("miaEta")
    dim mySurname
    mySurname = Request.Form("mioCognome")

    ' mappaggio database
    Session("strConn")="Provider=Microsoft.Jet.OLEDB.4 .0;Data Source=" & Server.MapPath("dati.mdb")
    Set dbconn=server.createobject("ADODB.Connection")
    dbconn.open Session("strConn")

    if mySurname != "" and myAge = "" then
    str="Select * from utenti where cognome='"& mySurname &"'"

    if myAge = "" and mySurname = "" then
    str="Select * from utenti where eta='"& myAge &"'"

    end if

    Set RS_Report=dbconn.execute(str)


    If not( RS_Report.BOF and RS_Report.EOF ) then
    %>
    </p>
    <table width="100%" border="1">
    <tr>
    <td width="2%">Id</td>
    <td width="5%">Nome</td>
    <td width="6%">Cognome</td>
    <td width="3%">Eta</td>
    <td width="17%">Cellulare</td>
    <td width="23%">Email</td>
    <td width="8%">User</td>
    <td width="9%">Password</td>
    <td width="3%">Ruolo</td>
    <td width="24%">Data</td>
    </tr>
    <tr>
    <%
    RS_Report.MoveFirst
    Do While not RS_Report.EOF
    %>
    <td><% = RS_Report("id")%></td>
    <td><% = RS_Report("nome")%></td>
    <td><% = RS_Report("cognome")%></td>
    <td><% = RS_Report("eta")%></td>
    <td><% = RS_Report("cellulare")%></td>
    <td><% = RS_Report("email")%></td>
    <td><% = RS_Report("user")%></td>
    <td><% = RS_Report("password")%></td>
    <td><% = RS_Report("ruolo")%></td>
    <td><% = RS_Report("data")%></td>
    </tr>
    <% RS_Report.MoveNext
    Loop
    %>
    </table>
    <%
    Else Response.Write("Non è stato trovato alcun valore")
    End if
    %>


    </p>

    </p>
    </body>
    </html>


    ----------------------------------

    l'errore è il seguente :

    Tipo di errore:
    Errore di compilazione di Microsoft VBScript (0x800A03F9)
    Previsto 'Then'
    /RICERCA/esegui_ricerca.asp, line 22, column 35
    if not mySurname = 0 and myAge = 0 ) then


    ...a me sembra almeno concettualmente corretto, cosa sbaglio? perchè dice che è previsto Then e then ci sta?

    Aiuto :-)

  2. #2
    diverso != in VBSCRIPT si scrive <> quindi la stringa diventa

    if mySurname <> "" and myAge = "" then

    se no il server interpreta male tutto per questo ti dice che manca il then non arriva a leggerlo...

    ciao

  3. #3

    cavolo ....

    mi sa che faccio un casino col js ... grande ... sono un neofita si vede è :-)

  4. #4

    ???

    ho sostituito != con <> , ora l'errore si è spostato dove c'è il testo in rosso e mi dice :

    Tipo di errore:
    Errore di compilazione di Microsoft VBScript (0x800A03F6)
    Previsto 'End'
    /RICERCA/esegui_ricerca.asp, line 69

    --------------- script -------------------------

    <html>
    <head>
    <title>esegui_ricerca</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>



    <%

    dim myAge
    myAge = Request.Form("miaEta")
    dim mySurname
    mySurname = Request.Form("mioCognome")

    ' mappaggio database
    Session("strConn")="Provider=Microsoft.Jet.OLEDB.4 .0;Data Source=" & Server.MapPath("dati.mdb")
    Set dbconn=server.createobject("ADODB.Connection")
    dbconn.open Session("strConn")

    if mySurname <> "" and myAge = "" then
    str="Select * from utenti where cognome='"& mySurname &"'"
    else if myAge <> "" and mySurname = "" then
    str="Select * from utenti where eta='"& myAge &"'"
    end if


    Set RS_Report=dbconn.execute(str)


    If not( RS_Report.BOF and RS_Report.EOF ) then
    %>
    </p>
    <table width="100%" border="1">
    <tr>
    <td width="2%">Id</td>
    <td width="5%">Nome</td>
    <td width="6%">Cognome</td>
    <td width="3%">Eta</td>
    <td width="17%">Cellulare</td>
    <td width="23%">Email</td>
    <td width="8%">User</td>
    <td width="9%">Password</td>
    <td width="3%">Ruolo</td>
    <td width="24%">Data</td>
    </tr>
    <tr>
    <%
    RS_Report.MoveFirst
    Do While not RS_Report.EOF
    %>
    <td><% = RS_Report("id")%></td>
    <td><% = RS_Report("nome")%></td>
    <td><% = RS_Report("cognome")%></td>
    <td><% = RS_Report("eta")%></td>
    <td><% = RS_Report("cellulare")%></td>
    <td><% = RS_Report("email")%></td>
    <td><% = RS_Report("user")%></td>
    <td><% = RS_Report("password")%></td>
    <td><% = RS_Report("ruolo")%></td>
    <td><% = RS_Report("data")%></td>
    </tr>
    <% RS_Report.MoveNext
    Loop
    %>
    </table>
    <%
    Else Response.Write("Non è stato trovato alcun valore")
    End if
    %>


    </p>

    </p>
    </body>
    </html>

    -------------------------------------------

    io pensavo che quando diceva previsto voleva dire una cosa che non c'è e va scritta End c'è .. osbaglio??? :-(

  5. #5
    in effetti c'è l'end ora non vorrei dire una cavolata ma prova a spostare il response.write dopo l'else una riga giù

    ma credo non c'entri nulla non so che dire

  6. #6
    trovato l'errore

    else if myAge <> "" and mySurname = "" then

    lo devi scrivere attaccato

    elseif

  7. #7

    6 un grande

    non ci posso credere che per una cosa del genere mi sbatto da 2 giorni :-)


    grazie infinite

  8. #8
    figurati

    buon lavoro

  9. #9

    ultima cosina

    ora funziona tutto tranne che se non scrivo nulla nei 2 campi cognome ed età

    mi da questo errore

    Tipo di errore:
    Microsoft JET Database Engine (0x80040E0C)
    Testo del comando non impostato per l'oggetto comando.
    /RICERCA/esegui_ricerca.asp, line 32

    e la linea 32 è Set RS_Report=dbconn.execute(str)


    ecco tutto lo script

    <html>
    <head>
    <title>esegui_ricerca</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>



    <%

    dim myAge
    myAge = Request.Form("miaEta")
    dim mySurname
    mySurname = Request.Form("mioCognome")

    ' mappaggio database
    Session("strConn")="Provider=Microsoft.Jet.OLEDB.4 .0;Data Source=" & Server.MapPath("dati.mdb")
    Set dbconn=server.createobject("ADODB.Connection")
    dbconn.open Session("strConn")

    if mySurname <> "" and myAge = "" then
    str="Select * from utenti where cognome='"& mySurname &"'"
    elseif myAge <> "" and mySurname = "" then
    str="Select * from utenti where eta='"& myAge &"'"
    elseif myAge <> "" and mySurname <> "" then
    str="Select * from utenti where cognome='"& mySurname &"' and eta='"& myAge &"'"
    elseif myAge = "" and mySurname = "" then
    Response.Write("Devi indicare almeno un valore")
    end if


    Set RS_Report=dbconn.execute(str)


    If not( RS_Report.BOF and RS_Report.EOF ) then
    %>
    </p>
    <table width="100%" border="1">
    <tr>
    <td width="2%">Id</td>
    <td width="5%">Nome</td>
    <td width="6%">Cognome</td>
    <td width="3%">Eta</td>
    <td width="17%">Cellulare</td>
    <td width="23%">Email</td>
    <td width="8%">User</td>
    <td width="9%">Password</td>
    <td width="3%">Ruolo</td>
    <td width="24%">Data</td>
    </tr>
    <tr>
    <%
    RS_Report.MoveFirst
    Do While not RS_Report.EOF
    %>
    <td><% = RS_Report("id")%></td>
    <td><% = RS_Report("nome")%></td>
    <td><% = RS_Report("cognome")%></td>
    <td><% = RS_Report("eta")%></td>
    <td><% = RS_Report("cellulare")%></td>
    <td><% = RS_Report("email")%></td>
    <td><% = RS_Report("user")%></td>
    <td><% = RS_Report("password")%></td>
    <td><% = RS_Report("ruolo")%></td>
    <td><% = RS_Report("data")%></td>
    </tr>
    <% RS_Report.MoveNext
    Loop
    %>
    </table>
    <%
    Else Response.Write("Non è stato trovato alcun valore")
    End if
    %>


    </p>

    </p>
    </body>
    </html>


    quando hai un attimo mi ci daresti un'occhiata? GRAZIE :-)

  10. #10
    il controllo per entrambi i campi vuoti mettilo all'inizio il problema è che così dai al database una query che non esite str infatti nel caso in cui i campi siano entrambi vuoti non viene creata.....fai così:

    <html>
    <head>
    <title>esegui_ricerca</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>



    <%

    dim myAge
    myAge = Request.Form("miaEta")
    dim mySurname
    mySurname = Request.Form("mioCognome")

    ' mappaggio database
    Session("strConn")="Provider=Microsoft.Jet.OLEDB.4 .0;Data Source=" & Server.MapPath("dati.mdb")
    Set dbconn=server.createobject("ADODB.Connection")
    dbconn.open Session("strConn")

    if myAge = "" and mySurname = "" then
    Response.Write("Devi indicare almeno un valore")
    else


    if mySurname <> "" and myAge = "" then
    str="Select * from utenti where cognome='"& mySurname &"'"
    elseif myAge <> "" and mySurname = "" then
    str="Select * from utenti where eta='"& myAge &"'"
    elseif myAge <> "" and mySurname <> "" then
    str="Select * from utenti where cognome='"& mySurname &"' and eta='"& myAge &"'"
    end if


    Set RS_Report=dbconn.execute(str)


    If not( RS_Report.BOF and RS_Report.EOF ) then
    %>
    </p>
    <table width="100%" border="1">
    <tr>
    <td width="2%">Id</td>
    <td width="5%">Nome</td>
    <td width="6%">Cognome</td>
    <td width="3%">Eta</td>
    <td width="17%">Cellulare</td>
    <td width="23%">Email</td>
    <td width="8%">User</td>
    <td width="9%">Password</td>
    <td width="3%">Ruolo</td>
    <td width="24%">Data</td>
    </tr>
    <tr>
    <%
    RS_Report.MoveFirst
    Do While not RS_Report.EOF
    %>
    <td><% = RS_Report("id")%></td>
    <td><% = RS_Report("nome")%></td>
    <td><% = RS_Report("cognome")%></td>
    <td><% = RS_Report("eta")%></td>
    <td><% = RS_Report("cellulare")%></td>
    <td><% = RS_Report("email")%></td>
    <td><% = RS_Report("user")%></td>
    <td><% = RS_Report("password")%></td>
    <td><% = RS_Report("ruolo")%></td>
    <td><% = RS_Report("data")%></td>
    </tr>
    <% RS_Report.MoveNext
    Loop
    %>
    </table>
    <%
    Else Response.Write("Non è stato trovato alcun valore")
    End if

    End if

    %>


    </p>

    </p>
    </body>
    </html>

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.