Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A pseudo SEEK() Function to be used with SPT
Message
From
05/07/2002 13:11:40
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00675579
Message ID:
00675704
Views:
10
>SELECT COUNT(*) FROM table WHERE field=99

I like this one. Below is the next "version" of SQLSeek, with your sugestions:
 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
Thanks!

Fernando
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform