Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create empty cursor proxy
Message
De
11/06/2006 14:04:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
How to create empty cursor proxy
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01128346
Message ID:
01128346
Vues:
198
My application uses the following code to add rows to remote table:
SQLEXEC(nConn, "SELECT * FROM makse WHERE false", 'makse')
... makse makse cursor updatable
INSERT INTO makse ... VALUES ...
TABLEUPDATE(.T.)
in a lot of places.

SQLEXEC() for creating empty table causes unnessecary server traffic.

I tried to to create proxy function but this works only first time.
After calling second time making curosr updatable returs error that propery is available for tables only.

How to create a proxy so that SQLEXEC() for creating empty
table is executed only once?
FUNCTION SPTCursorProXy(cRemote)
* Creates empty updatable SPT cursor for remote table cRemote

IF !USED(cRemote+'_proxy')
  IF SQLEXEC(nConn, "SELECT * FROM "+m.cRemote+" WHERE false", ;
        m.cRemote+'_proxy')<1
    RETURN .f.
    ENDIF
  ENDIF

SELECT * ;
  FROM (cRemote+'_proxy') ;
  INTO CURSOR (m.cRemote) READWRITE

ENDFUNC
Andrus
Répondre
Fil
Voir

Click here to load this message in the networking platform