Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TableUpdate() & Speed
Message
De
21/12/1999 12:33:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00306675
Message ID:
00306771
Vues:
35
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')
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform