Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't remove non-existant table
Message
From
07/11/2003 16:43:41
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00847802
Message ID:
00847823
Views:
16
>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)
** and if you get exclusive access...
Close Databases All
Open Database yourdatabase Exclusive
Pack Data
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform