Information générale
Catégorie:
Codage, syntaxe et commandes
>>Assume we have an memvar called cDesiredID
>>
>>Select Recno() as RecNum, Field1, Field2, etc from MyTable into Cursor MyCursor Where Member_ID = cDesiredID
>>
>>compared to:
>>
>>Seek cDesiredID
>>RecNoSave=Recno()
>>Copy to Array MyArray Fields AnyField, Field1,Field2, etc While Member_ID=cDesiredID
>>GoTo RecNoSave
>>For I=1 to _Tally
>> MyArray(i,1)=RecnoI()
>> Skip
>>EndFor
>>Use Mycursor
>>Zap
>>Append From Array MyArray
>>
>>Result: The second method, surprising to me, is much, much faster when MyCursor contains only a few (less than a dozen) records. I haven't tested it with more (not necessary in my app).
2 things
first - using the select SQL shouldn't be much slower if your
indexes are set right - but basically if every thing is
ok the select will do something simmilar
regarding option 2 - why use an array, u can simply CREATE CURSOR and copy directly into it
Arnon
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement