Don,
Never hardcode any path in your code or you'll have a lot of work when time comes to change it. You can store the path as a property of your application object. This way you'll have to change it in one place only, if necessary.
I consider it a good programming practice to open tables explicitly and reference them by there alias in a query.
lcTable = 'mytable'
IF NOT USED(lcSourcetable)
USE (oApp.cDataPath + lcTable) IN 0
ENDIF
SELECT * from (lcTable) into cursor crsNew
USE IN (lcTable)
I'm not sure why do you have to close a table to make it available to other programs. Are you running your program with
SET EXCLUSIVE ON
?
>I'm probably breaking protocol here but since you helped me with an earlier part on this I thought it might be OK to ask you directly,
>
>If I SELECT from a table that is not currently open into a cursor, the source table is opened in the process. If the source table is in a variable, how can I then close it so it is available to other programs?
>
>lcSourcetable = 'd:\mydir\mytable'
>SELECT * from (lcsourcetable) into cursor crsNew
>** release the source table
>use in (lcSourceTable)
>
--sb--