A whole new problem

steve711

Registered User.
Local time
Today, 08:47
Joined
Mar 25, 2004
Messages
166
Hello All.

I have a database that I can no longer open up and below is the error message I get. The strange thing is that the two computers that are using my database both have the same version of Access so I am not sure how this occurred and of course nobody is fessing up to messing with anything.

Any help in getting the tables out of the now defunct database would be great.

 
Hmm text

Ok guess I am not familar enough with adding a picture to a post so here is what the message says..... BTW I tried to import and I get this same message and it doesn't allow me to import them.


------
This database is in an unexpected stat;Microsoft Access can't open it.

This database has been converted froma prior version of Microsoft Access by using the DAO CompactDatabase method instead of the Convert Database command on the Tools menu (Database Utilities submenu). This has left the database in a partially converted state.

If you have a copy of the database in its original format, use the Convert Database command on the Tools menu to convert it. IF the original database is no longer available, create a new database and import your tables and queries to preserve your data. Your other database objects can't be recovered.
 
Thanks for the input. Here's the problem. I cannot import my tables and queries into the backup. Unless I am doing or selecting the wrong thing. I am going to File....Get external data....Import and I get the same stinking error message. Help, now this is becoming a critical issue if I cannot get the exiting data back.


Pat Hartman said:
The message seems pretty clear to me. Dust off your backup or be prepared to recreate everything. If your backup is too old, you can start with it to get back as many objects as possible and then import the data from the corrupted db.

BTW, this may be what happens if someone tries to open an .mdb with Word.
 
Here is a post I found on another website. Not sure if this will address your specific problem but if you are desperate, as in no backup anywhere, you might try and make sense of it:

My name is Frank Miller. Thank you for using the Microsoft Access
Newsgroups.

Simply opening the database file would not corrupt it unless the file was
being opened in another application such as Word, which would definitely
corrupt the database.

When opening a database in the Access user interface, if we receive the
error...

"The database is in an unexpected state. Microsoft Access can't open it.
This database has been converted from a prior version of MS Access by using
the DAO compact database method instead of the convert database command on
the tools menu (database utilities sub menu). This has left the database in
a partially converted state. If you have a copy of the database in its
original format, use the convert database command on the tools menu
(database utilities submenu) to convert it."

..we may not be able to convert the database. This message is usually due
to some corruption that has occurred in the database's project (forms,
reports, macros, modules).

To address this issue we should use standard corruption troubleshooting to
see if the problem can be corrected. However, more than likely, all
attempts to recover it will fail with the same error. In some cases, you
can recover the Jet database objects (tables and queries) by creating a new
database and using DAO code to bring the objects over. Even though you
cannot save the project items, at least the user may be able to recover
their data and queries. To use this technique, follow these steps:

1. Make a backup copy of the original database.

2. Start Microsoft Access.

3. Create a new, blank database.

4. Press ALT+F11 or on the Insert menu, click Module to launch the Visual
Basic Editor in a separate window, and will create a new module for you.

5. On the Tools menu, click References. This will display a References
dialog box.

6. Scroll down through the list, and check the box next to "Microsoft DAO
3.6 Object Library".

7. Click OK to close the References dialog box.

8. Copy and paste the following code into the new module that is open on
the screen:

Sub RecoverCorruptDB()
Dim dbCorrupt As DAO.Database
Dim dbCurrent As DAO.Database
Dim td As DAO.TableDef
Dim tdNew As DAO.TableDef
Dim fld As DAO.Field
Dim fldNew As DAO.Field
Dim ind As DAO.Index
Dim indNew As DAO.Index
Dim qd As DAO.QueryDef
Dim qdNew As DAO.QueryDef
Dim strDBPath As String
Dim strQry As String

'Replace the path below to the path of the corrupted database

strDBPath = "C:\My Documents\Appraisals.mdb"
On Error Resume Next
Set dbCurrent = CurrentDb
Set dbCorrupt = OpenDatabase(strDBPath)
For Each td In dbCorrupt.TableDefs
If Left(td.Name, 4) <> "MSys" Then
strQry = "SELECT * INTO [" & td.Name & "] FROM [" & td.Name &
"] IN '" & dbCorrupt.Name & "'"
dbCurrent.Execute strQry, dbFailOnError
dbCurrent.TableDefs.Refresh
Set tdNew = dbCurrent.TableDefs(td.Name)

'Recreate the indexes on the table

For Each ind In td.Indexes
Set indNew = tdNew.CreateIndex(ind.Name)
For Each fld In ind.Fields
Set fldNew = indNew.CreateField(fld.Name)
indNew.Fields.Append fldNew
Next
indNew.Primary = ind.Primary
indNew.Unique = ind.Unique
indNew.IgnoreNulls = ind.IgnoreNulls
tdNew.Indexes.Append indNew
tdNew.Indexes.Refresh
Next
End If
Next

'Recreate the queries

For Each qd In dbCorrupt.QueryDefs
If Left(qd.Name, 4) <> "~sq_" Then
Set qdNew = dbCurrent.CreateQueryDef(qd.Name, qd.SQL)
End If
Next
dbCorrupt.Close
Application.RefreshDatabaseWindow

MsgBox "Procedure Complete."
End Sub

This code should import all tables and queries from the damaged database
into the current database. Note that this solution does not take secured
databases into effect, so additional code to create workspaces, etc may be
needed if the database has been secured.

I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Regards, Frank Miller
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.
 
You are a life saver for posting that code on here. It worked like a champ. Now the hard part. Educating the bone head who (finally admitted) he tried to open it using Word and freaked out when it asked something he didn't understand. Anyway thanks.
 
just restore the program

First, found this error message listed here. I am using Access 2000. Op Sys should be Windows XP, but I am not sure that matters. Anyway, got into the data, the backend, and that looked okay. So, I made a copy of everything (just in case), restored a copy of the program from a few days ago BEFORE they got the error message, and had them check it. BINGO! Everything looks good! My point is: if the database is split and the data looks okay, try restoring a good copy of the program FIRST. You may get lucky, like me, and not have to recreate it per the instructions of Frank Miller.:cool:
 

Users who are viewing this thread

Back
Top Bottom