Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A pseudo SEEK() Function to be used with SPT
Message
 
To
05/07/2002 13:11:40
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00675579
Message ID:
00675710
Views:
10
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform