Antonio, Enrico,Mr Rao,
We have to decide for a way to go but with a few trials and small tables (30.000 records) its difficult to take an option.
May be you have some experience with it.
The problem is when we make a seek with more than on field in the seek expression.(locate will be the same):
1) Today's way in adordd
Opens another record set with where clause for that seek expression
This becomes the working record set with only the records matching the seek expression.
When we need to go to a record outside of this scope adordd has to "guess" it and return the previous
working record set.
This tends to be cumbersome.
Pros : Very fast.
One operation only- open new recordset
Cons: adordd has to do some guessing
2) Another way is to have a new record set with the records matching the seek expression.
Get the record number (defined autoinc field ) from the new record set accordingly to lsoftseek, lfindlast
Close the new record set.
:Find the record number from the new record set in the actual working record set
Return to normal operation.
Pros: adordd has nothing to "guess", same behavior as dbfs
In Oracle seems to be very fast in others DB dont know!
Cons: number of operations :
Open a new recordset
Close new recordset
:Find record in actual working record set
It will not work without some autoinc field to be used as recno because bookmarks
are not guarantee to be the same between difference record sets
EX.
- Code: Select all Expand view
nrec := recno()
if seek "whatever whatever2" // 2 fields in seek expression // 1) new recordset 2) the same
do while seek expression = .t.
....
skip
enddo
endif
go to nrec // 1) out of the scope needs to revert to previous record set 2) the same record set :find that record
Personally I like more option 2 but....
Please give me your ideas.