Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Codes in modules and forms are gone after converting a corrupt databas

Status
Not open for further replies.

junwebhead

Programmer
Jun 13, 2003
41
QA
Hi everyone!

I have a program in access 97 that became corrupted. Whenever i open the database, it will throw an "invalid reference to memory..." error then quit.

The first soultion I made is to import all database objects to a new database - but it failed.
Then i convert it to access 2000 then it becomes accecssible but the codes in forms and modules are gone and isn't working (e.g., OnMouseMove event generates an error.)

I can view the form in design view but viewing the code is not working even in modules.

How can i recover those codes?
Can anyone help me with this please.

Thanks in advance.

- jun [glasses]
 
Unfortunately, I don't know a way round this, but have had it happen to me. What I did was to tediously import each object in the database to a new database, leaving out the one(s) that failed. Then, import the failed objects from one of your backups ... you do have backups don't you?!!

You could try the undocumented sub routines SaveAsText and LoadFromText - you won't find any help on them, but Intellisense will prompt you for the parameters. The routines provide a way to export an object to a text file and read it back in to create the object again.
 
Actually, I'm not the one who created the program. It was only handed over to me and never made a revision to it since then so I didn't think of getting it a backup. The original author have a backup but it is outdated so I couldn't rely on that.

I tried SaveAsText but it return a "run-time error '2102':
The form name 'Form1' is mispelled or refers to a form that doesn't exists". Maybe the code is totally gone right?

May I know where did you get the information about SaveAsText and LoadFromText? Because I think I can make use of it in the future.

Thanks for your reply! I appreciate it so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top