>Why is the following code slow?
>
>Select * from myTable into cursor tmpTable
>Use Dbf("tmpTable") Again
>
>myTable has only 5 rows. The Select is quick but the Use Dbf("tmpTable") Again takes about 15 seconds.
>
The most likely cause is that the files doesn't really 'exist' until the second line is executed.
A SQL Select into a cursor, while it will associate a file name with it, in many cases doesn't actually create the file - it exists only in memory. When you issue the second line, if it's only in memory, the the file must be creted phsycially on disk, and the internal paperwork done, before it can be actually USEd.
Warning - the first line of code issues may make a filtered view. In this case, that means that you'd simply open the
entrie source table again with an alias. If you do something that may be Rushmore optimizable against a single table, if you need to actually open it again, you'd best add a NOFILTER clause.