Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL recalls deleted records
Message
 
 
À
20/01/2011 17:45:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01496776
Message ID:
01496778
Vues:
43
Ed,

Make sure to use SET DELETED ON and then deleted records will not be there.

>Deleted records are recalled when a cursor is created by SELECT-SQL query with keywords READWRITE or/and NOFILTER .
>Program below shows it. Is it correct? What could cause this?
>Thanks,
> Ed
>
>
>*!* program test_recall.prg
>*!* demonstrate recall of deleted records during SELECT-SQL cursor creation with keywords READWRITE or/and NOFILTER 
>CLOSE DATABASES 
>SET EXCLUSIVE ON
>SET SAFETY OFF 
>SELECT 0
>CREATE TABLE test_recall FREE (fid I(5) autoinc, fld2 N(6, 2))
>FOR lnRec = 1 TO 20  && Append 10 records
>   APPEND BLANK
>   REPLACE fld2 WITH 1 + 100 * RAND( )  && Insert random values
>ENDFOR
>DELETE FOR RECNO() > 10
>BROWSE TITLE "Table with deleted records. Click ESC"
>SELECT * from test_recall INTO CURSOR test 
>BROWSE TITLE "Cursor with deleted records. Click ESC"
>SELECT * from test_recall INTO CURSOR test READWRITE 
>BROWSE TITLE "Cursor created with READWRITE - deleted recalled. Click ESC"
>SELECT * from test_recall INTO CURSOR test NOFILTER 
>BROWSE TITLE "Cursor created with NOFILTER - deleted recalled . Click ESC"
>SELECT * from test_recall INTO CURSOR test READWRITE NOFILTER 
>BROWSE TITLE "Cursor created with READWRITE &  NOFILTER - deleted recalled . Click ESC"
>CLOSE DATABASES ALL 
>DELETE FILE test_recall.dbf
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform