Foros del Web » Programando para Internet » ASP Clásico »

codigo para busar error

Estas en el tema de codigo para busar error en el foro de ASP Clásico en Foros del Web. pagina que envia el formulario: Código: <form method="POST" action=consultascomercial_b.asp> <p align="left"><b><br>   Consultar visitas de comerciales</b></p> <p align="left">   Nombre comercial: <select size="1" name="comercial"> <%do while ...
  #1 (permalink)  
Antiguo 09/05/2002, 04:42
 
Fecha de Ingreso: abril-2002
Mensajes: 216
Antigüedad: 23 años
Puntos: 0
codigo para busar error

pagina que envia el formulario:
Código:
<form method="POST" action=consultascomercial_b.asp>
 
  <p align="left"><b><br>
    Consultar visitas de comerciales</b></p>

  <p align="left">   Nombre comercial:
  <select size="1" name="comercial">
  <%do while not miconexion.eof %>
  <option value=<% Response.write(miconexion.fields("dni") & " <br>")%><% response.write(miconexion.fields("nombre") & " <br>")%></option>
    <% miconexion.movenext
  loop%>
    <option selected value="*">Todos los comerciales</option>
  </select>

  <p align="left">  Visita realizada entre el día:<input type="text" name="fechaini" size="9">  <br>
    y el: <input type="text" name="fechafin" size="9">
  (ej.20/01/1981)<br>
    </p>
  <p align="center"><input type="submit" value="Enviar" name="B1"><input type="reset" value="borrar" name="B2"><br>
    </p>
  </form>
Pagina que lo recibe(aki esta el error)
Código:
 if comercial='*' and fechaini="" and fechafin="" then
strsql = "select * from visitas " 
	else if comercial='*' and fechaini<>"" and fechafin<>"" then
	strsql = "select * from visitas where fecha>="&fechaini& "and" &fecha<=fechafin
		else
		if fechaini="" and fechaini="" then
  		strsql="select * from visitas where dni=" &comercial
  			else
  			strsql="select * from visitas where dni= " &comercial& "and fecha >= " & fechaini & " and fecha <= "&
las variables comercial,fechaini y fechafin estan bien definidas. Podeis ayudar, el error está en los if creo.
Gracias
  #2 (permalink)  
Antiguo 09/05/2002, 06:33
 
Fecha de Ingreso: agosto-2001
Mensajes: 336
Antigüedad: 23 años, 8 meses
Puntos: 0
Re: codigo para busar error

¿Donde tienes los End if?

  #3 (permalink)  
Antiguo 09/05/2002, 07:29
 
Fecha de Ingreso: marzo-2002
Mensajes: 59
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: codigo para busar error

Yo tambien creo que el error está en que do pones la sentencia end if en tu código.

Prueba y nos comentas
  #4 (permalink)  
Antiguo 09/05/2002, 14:35
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: codigo para busar error

Deberías postear el error que te manda.!!

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #5 (permalink)  
Antiguo 09/05/2002, 19:10
Avatar de RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 23 años, 3 meses
Puntos: 50
Re: codigo para busar error

Asi es, donde quedaron los End IF????

  #6 (permalink)  
Antiguo 10/05/2002, 02:24
 
Fecha de Ingreso: abril-2002
Mensajes: 216
Antigüedad: 23 años
Puntos: 0
Re: codigo para busar error

los end if estaban puestos, lo que pasa es que al copiar y pegar... de todas maneras decidí hacerlo con una variable boolean, y tampoco me funciona... me estoy desesperando.
  #7 (permalink)  
Antiguo 10/05/2002, 09:13
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: codigo para busar error

mmmm
Deberías poner el error que te manda !!!!

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #8 (permalink)  
Antiguo 10/05/2002, 12:53
 
Fecha de Ingreso: mayo-2002
Ubicación: Mexico DF
Mensajes: 119
Antigüedad: 23 años
Puntos: 0
Re: codigo para busar error

Prueba esto amigo, no creo que habia necesidad de anidar los If


if (comercial=&quot;*&quot;) and (fechaini=&quot;&quot;) and (fechafin=&quot;&quot;) then

strsql = &quot;select * from visitas &quot;

End if

if (comercial='*') and (fechaini&lt;&gt;&quot;&quot;) and (fechafin&lt;&gt;&quot;&quot;) then
strsql = &quot;select * from visitas where fecha&gt;=&quot;&amp;fechaini&amp; &quot;and&quot; &amp;fecha&lt;=fechafin
End if

if (fechaini=&quot;&quot;) and (fechaini=&quot;&quot;) then
strsql=&quot;select * from visitas where dni=&quot; &amp;comercial
End If

if (fechaini=&quot;&quot;) and (fechaini=&quot;&quot;)and (comercial&lt;&gt;&quot;&quot;) then
strsql=&quot;select * from visitas where dni= &quot; &amp;comercial&amp; &quot;and fecha &gt;= &quot; &amp; fechaini &amp; &quot; and fecha &lt;= &quot;&amp;
End if

Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:35.