Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create empty cursor proxy
Message
From
11/06/2006 14:04:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
How to create empty cursor proxy
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01128346
Message ID:
01128346
Views:
192
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
Reply
Map
View

Click here to load this message in the networking platform