Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableUpdate() & Speed
Message
From
21/12/1999 12:33:52
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00306675
Message ID:
00306771
Views:
34
OPEN DATABASE 'MYDATABASE'

IF INDBC('myconnect','CONNECTION')
DELETE CONNECTION myconnect
ENDIF

CREATE CONNECTION myconnect DATASOURCE 'MYDATA' USERID 'MYUSER' PASSWORD 'MYPASSWORD'

IF INDBC('myview1','View')
DELETE VIEW myview1
ENDIF

Here is the code sample you requested. I hope it is of some help. Thanks

IF !USED('MYTABLE')
USE mytable SHARED IN 0
ENDIF

CREATE SQL VIEW myview1;
CONNECTION myconnect AS ;
SELECT *;
FROM pers

=DBSETPROP('myview1.PERS_NO','Field','KeyField',.T.)
=DBSETPROP('myview1','View','SendUpdates',.T.)

IF !USED('MYVIEW1')
SELECT 0
USE myview1
ENDIF

SELECT MYTABLE
GO TOP
DO WHILE !EOF()
SELECT myview1
* 1st time through is ok.
GO TOP && When returning here it crashes.... Says the connection is still busy
LOCATE FOR UPPER(ALLTRIM(MYTABLE.first_name)) == UPPER(ALLTRIM(myview1.first_name)) AND ;
UPPER(ALLTRIM(MYTABLE.last_name)) == UPPER(ALLTRIM(myview1.last_name))
IF FOUND()
cntr1 = cntr1 + 1
* This wait helps slow it down. but it takes forever to finnish
wait window ALLTRIM(STR(cntr1)) timeout 1
REPLACE myview1.title WITH MYTABLE.title
*!* TABLEUPDATE(.T., .F.,'myview1')
ENDIF
SELECT MYTABLE
SKIP
ENDDO
* Putting this here or above does not matter for the crash
TABLEUPDATE(.T., .F.,'myview1')
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform