Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A pseudo SEEK() Function to be used with SPT
Message
 
À
05/07/2002 13:11:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00675579
Message ID:
00675710
Vues:
9
Fernando,

>I like this one.

IMO it's the easiest and most portable solution, but not necessarily the fastest as Sergey mentioned. But it should be ok!

>Below is the next "version" of SQLSeek, with your sugestions:
> IIf (! Empty (pWhereCondition), " Where " + pWhereCondition, "")

Will there really be situations where you will pass an empty "seek" expression and want the Select executed when you do that? Just wondering about the IIF in the Select instead of an IF around the whole code inside the procedure ...

>Thanks!

You're welcome! Glad I could be of help ... and ... congratulations for Brasil's success at the soccer world cup :)

>
> Procedure SQLSeek
>*--------- -------
> LParameters pHandle  , pTable, pWhereCondition
> Local       cOldAlias, bFound, cSelectStr
>
> cOldAlias  = Select ()
>
> cSelectStr = "Select Count (*) as SeekCount From " + pTableName +
>              IIf (! Empty (pWhereCondition), " Where " + pWhereCondition, "")
>
> SqlExec (pHandle, cSelectStr, "CurSQLSeek")
>
> Select CurSQLSeek
>
> bFound = SeekCount > 0
>
> Use In CurSQLSeek
>
> Select (cOldAlias)
>
> Return bFound
>
> EndProc                         &&  of SQLSeek
>

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform