You're closing the table (look close):
> select tempcrs
>
> use dbf() again in 0 alias tempdbf && makes cursor RW instead of RO
> use
that "use" command closes alias tempcrs.
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.