Código:
Me da error en la definicion de las variables y tambien me da error en el primer if (if comercial<>'*' then...) si no defino las variables, es muy raro! <% defino variables y a algunas les doy valores dim comercial As String dim fechaini As String dim fechafin As String dim bwhere As boolean comercial= "'" & request.form("comercial") & "'" fechaini="#"&Cdate(request.form("fechaini"))&"#" fechafin="#"&Cdate(request.form("fechafin"))&"#" aki se conecta a la base de datos set conexion = createobject("ADODB.connection") conexion.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\inetpub\wwwroot\itresa.mdb" boolean bwhere=false if comercial<>'*' then strcomercial="where dni =" & comercial bwhere=true end if if fechaini<>"" then if bwhere=true then strfechaini="and fecha >=" &fechaini else strfechaini="where fecha >=" & fechaini bwhere=true end if if fechafin<>"" then if bwhere=true then strfechafin="and fecha <=" &fechafin else strfechafin="where fecha <=" &fechafin end if ejecuta consulta strsql="select * from visitas"&strcomercial &strfechaini &strfechafin set miconexion = conexion.execute (strsql)
HELP!!!


Gracias :)