Using Application.SaveAsText to export corrupt form?

HelenWy

Registered User.
Local time
Today, 21:06
Joined
Feb 3, 2009
Messages
30
I hope I've posted this in the right place - apologies if not!

I appear to have a corrupt form within my database, and it will take forever to recreate it from scratch so I was hoping to try what a few people seem to have suggested, which is to use Application.SaveAsText to export it, then import again.

The trouble is that my code/VBA knowledge is sparse and self-taught so I would really appreciate step by step instructions on how to use this piece of code, and also how to import the exported form again please.

I've tried various other things i.e. compact and repair, decompiling and debugging the code, resaving the form, resaving the database with another name... nothing works!

Thanks in advance.
 
You should have a copy that isn't corrupted. Import the form from that copy into your db. In case you had made changes (in code) that isn't in the copy, take a copy of the form's module and paste it into a Notepad document (in case you need it).
 
Try this link
 
But, if you don't have a backup (naughty naughty), I just found this function, maybe it'll do what you need:

http://edndoc.esri.com/arcobjects/8.3/Samples/Application Framework/ExportVBACode.htm

And, if you don't have a backup, make a weekly one at the very least!! I've put a batch file together that xcopies my DB into a backup folder on an external RAID array, and compacts it - it runs through task scheduler so you never need to worry about it!
 
Thanks guys - I do have a backup but it's not completed as a scheduled task by me so I don't actually know when it was done. Not that long ago but before the recent work I've done, which is the most annoying thing!

I'll try importing from the backup and see what happens...
 
Yep, all working now! As I thought the backup copy I have is older than ideally I would have liked but it's not the end of the world. Ho hum... will just have to put all the changes back in again then!
 
Great!!! Just copy the code from the corrupt one and paste into the imported one, then make the visual changes as you go along. By doing that when you Compile it would highlight what needs to addressed.

You would certainly need to deal with the root cause though. Good luck!
 

Users who are viewing this thread

Back
Top Bottom