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 08:54:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00675579
Message ID:
00675593
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform