Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor - changing original values
Message
De
05/05/2015 04:47:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/05/2015 16:16:11
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01619360
Message ID:
01619405
Vues:
55
>Hello Cetin
>
>Many thanks for your reply, i have only one question about your suggestion:
>
>
>Select  * from  TESTE into Cursor NewCursor READWRITE
>*--I have make the changes
>Select * from NewCursor into TESTE nofilter
>
>
>After make the changes into the NewCursor, you run the following SELECT to replace values into Original Cursor:
>
>
>Select * from NewCursor into TESTE nofilter
>
>
>Theses new values from NewCursor with nofilter clause, replace all the content of the Original Cursor, that´s correct ?
>
>What´s happen if the Original Cursor don´t have the clause READWRITE ?
>
>Because you know, this program is not build by me, i´am a reseller.
>Also, suppose the Cursor of my program have READWRITE clause activate, how can do to refresh this one, because i cannot have access to the code, i just know the name of the original cursor "TESTE" and the same one is show to me on a Browlist.
>
>Many thanks again
>
>Best regards
>Luis Santos


Yes, it would recreate that cursor (TESTE). It doesn't matter if it were created with READWRITE or NOFILTER. It would recreate it in either case. (However, there are some special cases that you cannot directly do this - you would know if it gives an error).

If cursor TESTE is the source of a grid, then before doing this, grid's recordsource should be set to nothing temporarily ('' - emty string). If you want to do it the way you tried (and if it is readwrite in that case) then instead of delete use zap.
select Teste
* set safety off && to prevent zap confirmation message
zap
append from dbf('NewCursor')
With Delete all, you are not 'removing' the records, you are only marking them as deleted, and that could lead to side effects (at least the record count would be doubled. If there is a unique index, you would get violation errors etc). My first preference would be select ... into cursor Teste nofilter (or readwrite if you wish).
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform