>Hello,
>I've got another developer in my shop that keeps deleting unneeded tables, rather than removing them from the DBC (no matter how many times I yell at him). I can modi the database, and choose the table, and it gives me an option to delete it (as it doesn't exist), and all is fine. However, I want to do this from code, and FREE TABLE, REMOVE TABLE and DROP TABLE don't work in this situation. What obvious thing am I missing this time? Thanks,
>
>jfh
Make him clean it up :)
or
You could hack the dbc -
BACKUP FIRST[note: this only works if
1. the table names in the database are the same as the file name
2. the tables are in the same directory [or at least the search path] as the database
Close Databases All
Open Database yourdatabase Shared
Cd (JustPath(DBC()))
Select objectid From DBC() ;
where objecttype="Table" ;
and !File(ForceExt(Alltrim(objectname),"dbf")) ;
into Cursor cuNotFound
Delete From DBC() ;
where objectid In (Select objectid From cuNotFound) ;
or parentid In (Select objectid From cuNotFound)
Close Databases All
Open Database yourdatabase Exclusive
Pack Data
Insanity: Doing the same thing over and over and expecting different results.