Remove table/Delete records of Corrupted table

Hi all, We want to clean up the data in one table in Navsion Database (NAS) which does not allow to view the records or to modify the structural changes in it. Currently we can just open this table only in design mode but not able to save anything in it. We tried to open this table through CODBC but it failed. Currently we are doing some research from CFRONT to get rid of the records in it but not successful. Is there any other way to get rid of the records from this table or remove the table permanently with out even checking the records in it? Restoring from back up is not an option. Sincerely, Sid

You have to know primary keys for these records. I never saw more than 10 such records in one table. So if you know primary key you should write code in codeunit: Record.“key field” := key1; Record.delete; Record.“key field” := key2; Record.delete; … On my experience this problems appear if hardware fails so records that was in commit cache are corrupted. Normally I just scroll through table until error message and then guess primary key. If you do not want this error appear again ask you customer to buy UPS.

Dear Val, Thanks alot for your suggestion. We don’t want any records in table; actually we want to delete the entire table. We have tried following code: Record.RESET; Record.DeleteALL; But still we get the table corruption message. Any ideas? TIA Sincerely, Sid

Try selecting a different key before you delete. This normally works if the corruption is in a sceondary key, but generally does not work if the corruption is in the primary key.Record.SELECTCURRENTKEY("Different Field"); Record.deleteall;Failing that, try adding a new key, select that key and then delete. PS did you actually try Val’s suggestion of deleting the specific records, that often works.

By the way was the error caused by a hardware failure, or did you code it in. It is possible to cause database corruptions in SQL or ODBC, by inserting invalide data. e.g. insert a lower case charachter into a CODE field.

quote:


Originally posted by ksid
Dear Val, Thanks alot for your suggestion. We don’t want any records in table; actually we want to delete the entire table. We have tried following code: Record.RESET; Record.DeleteALL;


The only idea that comes to my mind is Record.RESET; Record.DELETEALL (FALSE); It should delete all records no matter what code is in the ondelete trigger… But if that does not work… well… then you have a big problem… Are you having a backup from before crashing the database?? Regards,

Unfortunately Deleteall = Deleteall(false); [:(] **Record.DELETEALL([RunTrigger])** FALSE (default)so that wont help.

quote:


Originally posted by David Singleton
Unfortunately Deleteall = Deleteall(false); [:(] **Record.DELETEALL([RunTrigger])** FALSE (default)so that wont help.


Personally i was experienced that when using Deleteall and having something on the trigger it was executing it if not explicitally using false. (uncomment navision “feature” i suppose). Regards