>>That was a tip by Tamar Granor on the last NY User Group meeting.
>
>Did Tamar show this exact code for this exact purpose? Is the use of RECNO() in SELECT - SQL guaranteed to work in this manner in VFP9?
>
Basically, we were going to skip this slide but I asked Tamar to stop on this problem as it sounded interesting. It was very quick so I don't really remember if she showed this tip in action or not. It should be in her book too.
Hopefully she'll answer herself here later on.
>In earlier versions of VFP I got burned with some very hard-to-track bugs when using RECNO() in SELECTs. There were significant SQL engine enhancements in VFP9; maybe it's now safe to use it that way. However, VFP9 also supports more complex queries in general, and without a lot of testing, how can we be assured that RECNO() will work as expected in these scenarios?
>
>Another consideration is that using RECNO() in a query is not ANSI-compliant. So, you couldn't use it to pull data off a non-VFP backend.
That's for sure. In SQL Server you may use NextID trick, though I don't recall at the moment and need to search.
If it's not broken, fix it until it is.
My Blog