Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid and coursor
Message
De
19/04/2006 04:50:12
 
 
À
19/04/2006 04:43:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01114491
Message ID:
01114498
Vues:
14
Add "Readwrite" to the select statement where you create crsTemp.

>hi,
>thank you,
>i got error message
>Cannot update the cursor "crsTemp", since it is read-only.
>
>ldDate=date()
>SELECT no,date1,count1 FROM trans1 into CURSOR crsTemp WHERE date1=ldDate
>
>ldDate=date()
>SELECT no,date1,count1 FROM trans1 into CURSOR crsDummy WHERE date1=ldDate
>Select crsTemp && Which controls the grid
>zap
>append from dbf('crsDummy')
>thisform.grid1.refresh()
>
>thanks
>
>>I have a few tips for you.
>>1. Never, never, never use "where something=function()", because this means that the function must be executed for every single record, and will take a looong time.
>>SELECT no,date1,count1 FROM emp into CURSOR crsTemp WHERE date1=DATE() &&will take a looong time
>>
>>ldDate=date()
>>SELECT no,date1,count1 FROM emp into CURSOR crsTemp WHERE date1=ldDate && Will be fast, especially if you have an index tag on date1
>>2. Never select directly into the cursor which controls the grid! Use this solution
>>ldDate=date()
>>SELECT no,date1,count1 FROM emp into CURSOR crsDummy WHERE date1=ldDate
>>Select crsTemp && Which controls the grid
>>zap
>>append from dbf('crsDummy')
>>yourgrid.refresh()
>>3. Try to remember the tips we give you...! :-)
>>
>>>hi all,
>>>
>>>any idea,i got empty grid via this code
>>>
>>>&& myform-->event-->activate
>>>SELECT no,date1,count1 FROM emp into CURSOR crsTemp WHERE date1=DATE()
>>>brow&& ok
>>>****mygrid1.ControlSource=crsTemp.no,count1,date1
>>>thisform.grid1.refresh && empty grid
>>>
>>>thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform