• Viernes 26 de Abril de 2024, 23:47

Autor Tema:  Entra en IF siempre ignorando la condición O_o  (Leído 1983 veces)

oscarsb

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
Entra en IF siempre ignorando la condición O_o
« en: Miércoles 23 de Junio de 2010, 10:33 »
0
[HIGHLIGHT="ASP"]
      <script for=vedere event=onclick language=vbscript>
      
         code = form1.cbocodice.options.value

         <%rs1.movefirst%>
         <%while not rs1.eof%>
            codice = "<%=rs1("Codice")%>"
            <%if code = codice then%>
            
            alert (codice & " y " & code)
            
            ICnomeA = "<%=rs1("Nome_Azienda").value%>"
            form1.ICnomeA.value = ICnomeA
            'alert ICnomea
         
            ICresp = "<%=rs1("Responsabile").value%>"
            form1.ICresp.value = ICresp
            'alert ICresp
         
            ICtecnico = "<%=rs1("Tecnico_Net1").value%>"
            form1.ICtecnico.value = ICtecnico
            'Alert IStecnico
         
            ISprod = "<%=rs1("Prod_Mod").value%>"
            form1.ISprod.value = ISprod
            'Alert ISprod
         
            IStipo="<%=rs1("Tipologia").value%>"
            if IStipo = "Tower" then
            form1.IStipo(0).checked = true
            else
            form1.IStipo(1).checked = true
            end if
            'Alert IStipo
         
            IStype = "<%=rs1("Type").value%>"
            form1.IStype.value = IStype
            'Alert IStype
         
            ISserial="<%=rs1("Serial").value%>"
            form1.ISserial.value = ISserial
            'Alert ISserial
         
            IScpu="<%=rs1("CPU_Num").value%>"
            form1.IScpu.value = IScpu
            'Alert IScpu
         
            ISram="<%=rs1("RAM").value%>"
            form1.ISram.value = ISram
            'Alert ISram
         
            IShd="<%=rs1("HD").value%>"
            form1.IShd.value = IShd
            'Alert IShd
         
            ISraid="<%=rs1("Modello").value%>"
            form1.ISraid.value = ISraid
            'Alert ISraid
         
            ISbackup="<%=rs1("Backup_Capacita").value%>"
            form1.ISbackup.value = ISbackup
            'Alert ISbackup
         
            ISscsi="<%=rs1("SCSI").value%>"
            form1.ISscsi.value = ISscsi
            'Alert ISscsi
         
            ISnastri="<%=rs1("Nastri").value%>"
            form1.ISnastri.value = ISnastri
            'Alert ISnastri
         
            ISso="<%=rs1("SO").value%>"
            form1.ISso.value = ISso
            'Alert ISso
         
            ISserver="<%=rs1("Server").value%>"
            form1.ISserver.value = ISserver
            'Alert ISserver
         
            ISdominio="<%=rs1("Dominio").value%>"
            form1.ISdominio.value = ISdominio
            'Alert ISdominio
         
            ISadmin="<%=rs1("Pass_Admin").value%>"
            form1.ISadmin.value = ISadmin
            'Alert ISadmin
         
            ISdisco="<%=rs1("Config_Disco").value%>"
            form1.ISdisco.value = ISdisco
            'Alert ISdisco
         
            ISlogiche="<%=rs1("Part_Logiche").value%>"
            form1.ISlogiche.value = ISlogiche
            'Alert ISlogiche
         
            ISip="<%=rs1("IP").value%>"
            form1.ISip.value = ISip
            'Alert ISip
         
            ISmask="<%=rs1("Mask").value%>"
            form1.ISmask.value = ISmask
            'Alert ISmask
         
            ISgateway="<%=rs1("Gateway").value%>"
            form1.ISgateway.value = ISgateway         
            'Alert ISgateway
         
            ISdhcp="<%=rs1("DHCP").value%>"
            form1.ISdhcp.value = ISdhcp
            'Alert ISdhcp
         
            ISrange="<%=rs1("Range").value%>"
            form1.ISrange.value = ISrange
            'Alert ISrange
         
            Servizi="<%=rs1("Servizi").value%>"
            form1.Servizi.value = Servizi
            'Alert Servizi
         
            Software="<%=rs1("Software").value%>"
            form1.Software.value = Software
            'Alert Software
         
            ANnome="<%=rs1("AN_anti").value%>"
            form1.ANnome.value = ANnome
            'Alert ANnome
         
            ANnum="<%=rs1("AN_utenti").value%>"
            form1.ANnum.value = ANnum
            'Alert ANnum
         
            ANuser="<%=rs1("AN_user").value%>"
            form1.ANuser.value = ANuser
            'Alert ANuser
         
            ANpass="<%=rs1("AN_pass").value%>"
            form1.ANpass.value = ANpass
            'Alert ANpass
         
            ANpassc="<%=rs1("AN_passc").value%>"
            form1.ANpassc.value = ANpassc
            'Alert ANpassc
         
            GC="<%=rs1("GC").value%>"
            if GC = "Si" then
            form1.gc(0).checked = true
            else
            form1.gc(1).checked = true
            end if
            'Alert gc
         
            GCid="<%=rs1("GC_Utent").value%>"
            form1.GCid.value = GCid
            'Alert GCid
         
            GCpass="<%=rs1("GC_Pass").value%>"
            form1.GCpass.value = GCpass
            'Alert GCpass
         
            Rmarca="<%=rs1("R_Marca").value%>"
            form1.Rmarca.value = Rmarca
            'Alert Rmarca
         
            Rnome="<%=rs1("R_Nome").value%>"
            form1.Rnome.value = Rnome
            'Alert Rnome
         
            Ruser="<%=rs1("R_User").value%>"
            form1.Ruser.value = Ruser
            'Alert Ruser
         
            Rpass="<%=rs1("R_Pass").value%>"
            form1.Rpass.value = Rpass
            'Alert Rpass
         
            Rip="<%=rs1("R_IP").value%>"
            form1.Rip.value = Rip
            'Alert Rip
         
            Rnet="<%=rs1("R_Acquistato").value%>"
            if Rnet="Si" then
            form1.Rnet(0).checked = true
            else
            form1.Rnet(1).checked = true
            end if
            'Alert Rnet
         
            Fmarca="<%=rs1("F_marca").value%>"
            form1.Fmarca.value = Fmarca
            'Alert Fmarca
         
            Fnome="<%=rs1("F_nome").value%>"
            form1.Fnome.value = Fnome
            'Alert Fnome
         
            Fuser="<%=rs1("F_user").value%>"
            form1.Fuser.value = Fuser
            'Alert Fuser
         
            Fpass="<%=rs1("F_pass").value%>"
            form1.Fpass.value = Fpass
            'Alert Fpass
         
            Fip="<%=rs1("F_IP").value%>"
            form1.Fip.value = Fip
            'Alert Fip
         
            Fnet="<%=rs1("F_Acquistato").value%>"
            
            if Fnet="Si" then
            form1.Fnet(0).checked = true
            else
            form1.Fnet(1).checked = true
            end if
            'Alert Fnet
         
            note="<%=rs1("Note").value%>"
            form1.note.value = note
            'Alert note
         <%end if%>
         <%rs1.movenext%>
      <%wend%>
      </script>[/HIGHLIGHT]

Value del combobox que simboliza el código de una tabla. Simplemente comparo el value con el código para que saque los datos de esa fila.

El problema es que sean o no iguales los valores, siempre entra en IF y muestra en el formulario todos los datos de todas las filas de la tabla hasta el EOF.

IMAGEN DEL FALLO Y DE LA INTERFAZ -> h ttp://img708.imageshack.us/img708/2825/alert.jpg

En la imagen podemos ver que siendo los valores diferentes, sigue entrando en el IF hasta que llega al EOF gracias al Alert XD

Un saludo

colocado

  • Nuevo Miembro
  • *
  • Mensajes: 7
    • Ver Perfil
Re: Entra en IF siempre ignorando la condición O_o
« Respuesta #1 en: Viernes 5 de Noviembre de 2010, 13:00 »
0
Hola.

Intenta castear los dos valores al mismo tipo csrt(val1) = cstr(val2) a ver si te compara asi.

saludos.