>I occasionally want to copy the structure from an SQL table to a temporary DBF file on my hard disk. I use a DBC because the SQL table has long field names.
>
>The easy way is
>Open database SQL_views
>Use sql_data_file nodata
>Copy stru to xxtemp database tempwork
>
>PROBLEM is that xxtemp.dbf might exist and might be part of a different dbc.
>
>So I can not just erase xxtemp.dbf and I can not open tempwork.dbc and delete xxtemp because it may be part of another DBC.
>
>Even after I have erased xxtemp.DBF and erased the DBC (tempwork.*), it STILL says that xxtemp.dbf already exists as part of a database.
>
>How can I overwrite file xxtemp.dbf and remove it from whatever DBC it is attached to?
>
>How do I know what DBC that a given dbf is attached to (or not attached)?
Joel,
1) If later on the way you don't need to change structure further you might use a cursor instead.
2) If cursor is not an option, create your temp dbc, create tables with sys(2015) names (aliases could be friendly). When done, delete the dbc and its tables.
Cetin