🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #3417

Re: Algun master q me pueda explicar este codigo plis

#3417
From: Noise
Date: Mon, 28 Feb 2005 00:14
49 lines
2188 bytes
> Private Sub AplicaFiltro()
> Dim tFiltro As String
>      tFiltro = ""
>
>      If Trim(Form_Fld_Run) <> "" Then
>        tFiltro = tFiltro & "(Fld_PRORUN =" & Form_Fld_Run & ") AND "
>    End If
> //porq los signos asteriscos q funcion cumplen aca y las comillas simples.
>     If Form_Fld_Nombre <> "" Then
>        tFiltro = tFiltro & "(Fld_PRONOMBRE LIKE '*" & Form_Fld_Nombre &
> "*') AND "
>    End If

La comilla simple es el limitador de strings...el asterisco quiere ser un 
comodin, pero est� mal por que al menos en SQL Server el simbolo correcto es 
el %

>
>  //Aca no entiendo a causa de que esta haciendo un LEN(parametro) > a 5
> �porque? sera q hay espacios en el tfiltro o algo por el estilo.
>
>    If Len(tFiltro) > 5 Then
>        tFiltro = UCase(Trim(Mid(tFiltro, 1, Len(tFiltro) - 5)))
>    Else
>        tFiltro = ""
>    End If

La idea del len es eliminar el ") AND " cuando exista al menos un filtro, 
para evitar un error de sintaxis

>
>    If tFiltro <> "" Then
>        registros.Filter = tFiltro
>    Else
>        registros.Filter = ""
>        registros.Requery
>    End If
>
>    carga_grilla
>
> End Sub
>
> De antemano se agradece cualquier ayuda e informacion.
>
> Atte
>
> Claudio T.
>
> 
Technical Details
Message-ID: <42226257$1_2@nova.entelchile.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.kjsl.com!news1.nivel5.cl!nova.entelchile.net
References: <cvnu8l$9du$1@news1.nivel5.cl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,42232fb7fe1756de
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII
From: "Noise" <noise@yahoo.com>
Newsgroups: chile.comp.programacion
References: <cvnu8l$9du$1@news1.nivel5.cl>
Subject: Re: Algun master q me pueda explicar este codigo plis
Date: Sun, 27 Feb 2005 21:14:14 -0300
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 200.72.214.118
X-Original-NNTP-Posting-Host: 200.72.214.118
Message-ID: <42226257$1_2@nova.entelchile.net>
X-Trace: nova.entelchile.net 1109549655 200.72.214.118 (27 Feb 2005 21:14:15 -0300)
X-Original-NNTP-Posting-Host: 200.72.214.118
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.kjsl.com!news1.nivel5.cl!nova.entelchile.net