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!

Can I use "SaveAsText" to save db objects from inaccessible database?

Status
Not open for further replies.

junwebhead

Programmer
Jun 13, 2003
41
QA
I have this access 97 database that became inaccessible. (When opening it will throw "Microsoft Access: MSACCESS.EXE - Application Error The instruction at "0x65102458" referenced memory at "0x00000040". The memory could not be "read"...." then quits.)

I succesfully compacted it using Jet Compact Utility (Jetcomp.exe). But still not working.

I've tried to repair it but it is still the same.

When I converted it to access 2000, It became accessible. All the objects are there but the form and module's code are gone.

Someone suggested that I could use SaveAsText function to save it to a text file then LoadFromText to retrieve it again. But it just throws an error. I think the codes are totally gone after the conversion. So now I'm thinking of using SaveAsText from another database module to save all objects from the corrupted database to a text file. (Hoping that the codes are still there.)

Can someone please help me with this?

Thanks!

Jun
 
Check the Corrupt MDBs FAQ below for possible corruption causes. I think it's a code error which will be fixed by using the /decompile command-line option, followed by opening the database and selecting Compile All Modules. But then again, I might be wrong. There are many other options available there.

PS--try importing the objects from the corrupt database and see if you can get at them that way.

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
Thanks for the reply foolio!

I looked at the Corrupt MDBs FAQs and found nothing that works.

I tried /decompile but I still get the same error.
Maybe /decompile never had a chance to work because the error is blocking the entrance to the program or something.

So I thought I could use SaveAsText to sneak from behind. Bypassing the error. Maybe without opening the database from access.

Got any other ideas?
 
Have you tried creating a new blank database and importing all of the objects? It could be that just one corrupt object is knobbling the entire database. If so, keep importing, taking note of any objects that fail and exclude that item from the next import attempt. You won't get all of your database, but you should stand a decent chance of recovering 90% of it.

In order to use SaveAsText you must be able to get into the database/object/code. If you can't, it's not going to work. The function is of more use as a backup tool than disaster recovery.
 
If you are desperate/are willing to pay, there are firms that will recover your data and/or code for you. It all depends on what you're losing in this database.

I don't think there's a utility out there to "grab" the text from one or more code modules--they exist, but only for using when the database is open, not for grabbing the info directly from the MDB file structure. So if you can't access the code module in a regular fashion, you will not be able to use someone's "basModuleToTextFile".


Try the importing objects fix--and if that has already failed, then consider firing up a backup/rebuilding your code.


Good luck.


PS--have you tried opening your database with the SHIFT key held down? This will bypass any startup procedures you may have. If this works and you can get in the database, press CTRL-G and select Debug->Compile And Save All Modules.
 
Thanks Norris. Yes, I tried importing all objects to a blank database but then again, it failed. I can't import even a single object.

I recovered all of the objects (When I converted it to access 2000) even all records in the table but I'm not that interested in recovering tables because most of them are linked. I can even view the forms and reports in design view but the codes aren't there.

I'm wondering if I could use SaveAsText from another database.

Yes Foolio, I frequently use the SHIFT key when opening that database but still nothing. Thanks for the suggestion, but I'm not looking to the option of paying some firm for a recovery. I'm willing to rebuild the code but it would hurt and take some time because I'm not the one who originally created it. It was only handed over to me when the creator retired. He has a backup but it was outdated. That's why I'm searching for a faster solution.

Thanks for all your help guys!

Jun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top