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

    Type mismatch: 'isnull(...)'----Type mismatch:cint

    Salve ragazzi ho un problema: sto realizzando una pagina per la ricerca avanzata di un sito.
    in locale tutto ok ma appena carico il file sul server (aruba) mi dice praticamente che i tipi di variabile sono incompatibili tra loro. provo a postare parte di codice nella speranza che qualcuno di buon animo mi aiuti..... sono nel panico piu completo::::::

    <%
    peso1=Request.querystring("peso1")
    sendpeso="1"
    peso2=Request("peso2")
    marca=Request("marca")
    allestimento=request("allestimento")
    anno1=request("anno1")
    anno2=request("anno2")
    ppeso=false
    speso=false
    allest=false
    panno=false
    sanno=false
    If IsNull (peso1)=true Then
    peso1=1
    sendpeso=2
    end if
    var=request.querystring("var")
    If IsNumeric(var) = False Or var < 1 Then
    esiste=true
    var=1
    end if
    If IsNull(peso1) = false then
    ppeso=true
    var=2
    end if
    If IsNumeric(peso2) = true and peso2 >2 then
    speso=true
    var=3
    end if
    If IsNumeric(allestimento) = false and isnull(allestimento)= false then
    alles=true
    var=4
    end if
    If IsNull(anno1) = false then
    panno=true
    var=5
    end if
    If IsNull(anno2) = false then
    sanno=true
    var=6
    end if
    if ppeso=false and speso=false and alles=false and panno=false and sanno=true then
    var=7
    end if
    if ppeso=false and speso=false and alles=false and panno=true and sanno=false then
    var=8
    end if
    if ppeso=false and speso=false and alles=false and panno=true and sanno=true then
    var=9
    end if
    if ppeso=false and speso=false and alles=true and panno=false and sanno=false then
    var=10
    end if
    if ppeso=false and speso=false and alles=true and panno=false and sanno=true then
    var=11
    end if
    if ppeso=false and speso=false and alles=true and panno=true and sanno=false then
    var=12
    end if
    if ppeso=false and speso=false and alles=true and panno=true and sanno=true then
    var=13
    end if
    if ppeso=false and speso=true and alles=false and panno=false and sanno=false then
    var=14
    end if
    if ppeso=false and speso=true and alles=false and panno=false and sanno=true then
    var=15
    end if
    if ppeso=false and speso=true and alles=false and panno=true and sanno=false then
    var=16
    end if
    if ppeso=false and speso=true and alles=true and panno=false and sanno=false then
    var=17
    end if
    if ppeso=false and speso=true and alles=true and panno=false and sanno=true then
    var=18
    end if
    if ppeso=false and speso=true and alles=true and panno=true and sanno=true then
    var=19
    end if
    if ppeso=true and speso=false and alles=false and panno=false and sanno=false then
    var=20
    end if
    if ppeso=true and speso=false and alles=false and panno=false and sanno=true then
    var=21
    end if
    if ppeso=true and speso=false and alles=false and panno=true and sanno=false then
    var=22
    end if
    if ppeso=true and speso=false and alles=false and panno=true and sanno=true then
    var=23
    end if
    if ppeso=true and speso=false and alles=true and panno=false and sanno=false then
    var=24
    end if
    if ppeso=true and speso=false and alles=true and panno=false and sanno=true then
    var=25
    end if
    if ppeso=true and speso=false and alles=true and panno=true and sanno=false then
    var=26
    end if
    if ppeso=true and speso=false and alles=true and panno=true and sanno=true then
    var=27
    end if
    if ppeso=true and speso=true and alles=false and panno=false and sanno=false then
    var=28
    end if
    if ppeso=true and speso=true and alles=false and panno=false and sanno=true then
    var=29
    end if
    if ppeso=true and speso=true and alles=false and panno=true and sanno=false then
    var=30
    end if
    if ppeso=true and speso=true and alles=false and panno=true and sanno=true then
    var=31
    end if
    if ppeso=true and speso=true and alles=true and panno=false and sanno=false then
    var=32
    end if
    if ppeso=true and speso=true and alles=true and panno=false and sanno=true then
    var=33
    end if
    if ppeso=true and speso=true and alles=true and panno=true and sanno=false then
    var=34
    end if
    if ppeso=true and speso=true and alles=true and panno=true and sanno=true then
    var=35
    end if
    if ppeso=false and speso=true and alles=false and panno=true and sanno=true then
    var=36
    end if
    if ppeso=false and speso=true and alles=true and panno=true and sanno=false then
    var=37
    end if
    %>



    </head>
    <body>

    poi a questo punto c'è il menu poi questo:::::





    <form id="ric" method="get" action="ricercaavanzata.asp">
    </td></tr><tr>



    <td width="30%">
    <span class="left">Portata totale a terra</span> </td><td width="20%"/><td><span class="right">Prima Immatricolazione</span>
    </td></tr><tr><td colspan="3">
    [Da qli
    <select name="peso1" style="width: 67px" >
    <%if sendpeso=2 then%>
    <%rs.Close
    rs.open "select distinct peso from vendita ",cn,1


    %>
    <% While rs.EOF = False%>
    <option onClick="javascript:formsubmit()" value="<%=rs("peso")%>"><%=rs("peso")%></option>
    <%rs.movenext
    wend%>
    <%else%>
    <%rs.Close
    rs.open "select distinct peso from vendita ",cn,1
    %>
    <% While rs.EOF = False%>
    <option onClick="javascript:formsubmit()" value="<%=rs("peso")%>" <%if rs("peso")= peso1 then%> selected="selected" <%end if%> ><%=rs("peso")%></option>
    <%rs.movenext
    wend%>
    <%end if%>

  2. #2
    </select>
    A qli
    <select name="peso2" style="width: 67px">
    <%if sendpeso=2 then%>
    <%rs.Close
    rs.open"select distinct peso from vendita order by peso asc",cn,1
    %>
    <% While rs.EOF = False%>
    <option value="<%=rs("peso")%>" <%if rs("peso")= "peso2" then%> selected="selected" <%end if%> onClick="javascript:formsubmit()"><%=rs("peso")%></option>
    <%rs.movenext
    wend%>
    <%else%>
    <% scambio=peso1
    rs.Close
    rs.open"select distinct peso from vendita where vendita.peso > "&peso1&"",cn,1
    %>
    <% While rs.EOF = False%>
    <option value="<%=rs("peso")%>" <%if rs("peso")= (cint(request("peso2"))) then%> selected="selected" <%end if%> onClick="javascript:formsubmit()"><%=rs("peso")%></option>
    <%rs.movenext
    wend%>
    <%end if%> </select>]


    Marca <select name="marca" style="width: 130px">
    <option/>
    <%rs.Close
    rs.open"select distinct marca from vendita",cn,1
    %>
    <% While rs.EOF = False%>
    <option value="<%=rs("marca")%>" <%if rs("marca")= (request("marca")) then%> selected="selected" <%end if%> ><%=rs("marca")%></option>
    <%rs.movenext
    wend%></select>

    Allestimento <select name="allestimento" style="width: 130px">
    <option/>
    <%rs.Close
    rs.open"select distinct allestimento from vendita",cn,1
    %>
    <% While rs.EOF = False%>
    <option value="<%=rs("allestimento")%>" <%if rs("allestimento")= (request("allestimento")) then%> selected="selected" <%end if%> onClick="javascript:formsubmit()"><%=rs("allestime nto")%></option>
    <%rs.movenext
    wend%></select>
    <input name="var" type="hidden" value="<%=var%>"/>



    [Da anno <select name="anno1" style="width: 67px">


    <%if sendpeso=2 then%>
    <%rs.Close
    rs.open"select distinct anno from vendita ",cn,1
    %>
    <% While rs.EOF = False%>
    <option onClick="javascript:formsubmit()" value="<%=rs("anno")%>" <%if rs("anno")= request("anno1") then%> selected="selected" <%end if%>><%=rs("anno")%></option>
    <%rs.movenext
    wend%>
    <%else%>
    <%rs.Close
    rs.open"select distinct anno from vendita ",cn,1




    %>
    <% While rs.EOF = False%>
    <option onClick="javascript:formsubmit()" value="<%=rs("anno")%>" <%if rs("anno")= request("anno1") then%> selected="selected" <%end if%> ><%=rs("anno")%></option>
    <%rs.movenext
    wend%>
    <%end if%>


    </select>
    A anno <select name="anno2" style="width: 67px">
    <option></option>

    <%app=request("anno1")
    if isnull(anno1) then%>
    <%rs.Close
    rs.open"select distinct anno from vendita ",cn,1
    %>
    <% While rs.EOF = False%>
    <option value="<%=rs("anno")%>" <%if rs("anno")= request("anno2") then%> selected="selected" <%end if%> onClick="javascript:formsubmit()"><%=rs("anno")%></option>
    <%rs.movenext
    wend%>
    <%else%>
    <%rs.Close
    rs.open"select distinct anno from vendita where vendita.anno>'"&app&"'",cn,1
    %>
    <% While rs.EOF = False%>
    <option value="<%=rs("anno")%>" <%if rs("anno")= request("anno2") then%> selected="selected" <%end if%> onClick="javascript:formsubmit()"><%=rs("anno")%></option>
    <%rs.movenext
    wend%>
    <%end if%>


    </select>]<input name="Submit1" type="submit" value="CERCA" style="width: 251px;"/>

    </form>
    </td></tr></table>

    <table align="center" width="100%" border="1">
    <%
    esistenza=true
    select case var
    case 1
    rs.close
    rs.open "select * from vendita order by peso asc",cn,1

    case 7
    rs.close
    rs.open "select * from vendita where vendita.anno <= '"&anno2&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 8
    rs.close
    rs.open "select * from vendita where vendita.anno >= '"&anno1&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 9

    if anno2 <= anno1 then
    esistenza=false
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    else
    rs.close
    rs.open "select * from vendita where vendita.anno>='"&anno1&"' and vendita.anno<='"&anno2&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    end if
    case 10
    rs.close
    rs.open "select * from vendita where vendita.allestimento = '"&allestimento&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 11
    rs.close
    rs.open "select * from vendita where vendita.allestimento = '"&allestimento&"' and vendita.anno<='"&anno2&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 12
    rs.close
    rs.open "select * from vendita where vendita.allestimento = '"&allestimento&"' and vendita.anno>='"&anno1&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 13

    if anno2 <= anno1 then
    esistenza=false
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    else
    rs.close
    rs.open "select * from vendita where vendita.anno>='"&anno1&"' and vendita.anno<='"&anno2&"' and vendita.allestimento='"&allestimento&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    end if
    case 14
    rs.close
    rs.open "select * from vendita where vendita.peso <= "&(cint(peso2))&" order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 15
    rs.close
    rs.open "select * from vendita where vendita.peso <= "&(cint(peso2))&" and vendita.anno<='"&anno2&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 16
    rs.close
    rs.open "select * from vendita where vendita.peso <= "&(cint(peso2))&" and vendita.anno>='"&anno1&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 17
    rs.close
    rs.open "select * from vendita where vendita.peso <= "&(cint(peso2))&" and vendita.allestimento>='"&allestimento&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 18
    rs.close
    rs.open "select * from vendita where vendita.peso <= "&(cint(peso2))&" and vendita.anno<='"&anno2&"' and vendita.allestimento>='"&allestimento&"' order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    case 19

    if anno2 <= anno1 then
    esistenza=false
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    else
    rs.close
    rs.open "select * from vendita where vendita.anno>='"&anno1&"' and vendita.anno<='"&anno2&"' and vendita.allestimento='"&allstimento&"' and vendita.peso<= "&(cint(peso2))&" order by peso asc",cn,1
    If Rs.Eof OR Rs.Bof Then
    Response.Write("<center><font color='red'>Non ci sono risultati per questa selezione.</font></center>")
    esistenza=false
    end if
    end if

  3. #3
    e cosi via..... insomma sono nel panico piu totale per favore un aiuto!!!!!!

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Errore?
    Che riga?

    Roby

  5. #5
    comincia a darmi errore dalla riga n13 (premetto che è un valore mandato dal form)

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    E la riga 13 sarebbe??? Su coraggio.... un po' di impegno non siamo a scuola.

    Roby

  7. #7
    mi dice Type mismatch: 'isnull(...)' all'istruzione::::If IsNull(peso1) Or peso1 < 1 Then

  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Quella riga non c'è.


    Roby

  9. #9
    ok chiedo scusa ho postato il codice che ho provato a modificare a caso ancora scusa si trova qui (questa è la parte di codice che ho provato in locale e che funziona off line)
    intanto grazie per l'interessamento

    <%
    peso1=Request("peso1")
    sendpeso="1"
    peso2=Request("peso2")
    marca=Request("marca")
    allestimento=request("allestimento")
    anno1=request("anno1")
    anno2=request("anno2")
    ppeso=false
    speso=false
    allest=false
    panno=false
    sanno=false
    If IsNull(peso1) Or peso1 < 1 Then
    peso1="1"
    sendpeso="2"
    end if
    var=request.querystring("var")
    If IsNumeric(var) = False Or var < 1 Then
    esiste=true
    var=1
    end if
    If IsNumeric(peso1) = true and peso1 >2 then
    ppeso=true
    var=2
    end if
    If IsNumeric(peso2) = true and peso2 >2 then
    speso=true
    var=3
    end if
    If IsNumeric(allestimento) = false and isnull(allestimento)= false then
    alles=true
    var=4
    end if
    If IsNumeric(anno1) = true and anno1 >1 then
    panno=true
    var=5
    end if
    If IsNumeric(anno2) = true and anno2 >1 then
    sanno=true
    var=6
    end if

  10. #10
    1. usa il tasto [CODE] per mettere il codice
    2. evidenzia quale riga ti dà errore

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.