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 08:54:46
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00675579
Message ID:
00675593
Views:
10
Hi Fernando,

looks ok so far. Nevertheless I would suggest some changes:
Procedure SQLSeek 
 LParameters pHandle, pTable, pWhereCondition

 Local cSelectStr, bFound, lnOldSelect

 IF NOT EMPTY(pWhereCondition)  && Or is there a need to query all records?

   lnOldSelect = SELECT()  && Save old workarea

   *-- No need to select * and transfer the whole record over the wire
   cSelectStr = " Select 1 From " + pTableName + " WHERE " + pWhereCondition
   SqlExec(pHandle, cSelectStr, "CurSQLSeek")

   *-- You might also want to check, if the call to sqlexec succeeded

   bFound = RecCount("CurSQLSeek") > 0
   Use In CurSQLSeek

   SELECT (lnOldSelect)

 ENDIF

 Return bFound

EndProc
HTH,
Armin

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