Table 'MSysAccessObjects' already exists

B

Brucels

I am receiving this error message when I attempt to open an Access 2000 .mdb
file. I also receive it when I try to import from that file into a new .mdb
file. I opened the file with no problem two days ago and closed it normally
(as far as I know). The error started appearing yesterday when I first tried
to open it. Unfortunately, the file was backed up overnight, so the previous
version is not available.

I have read all of the references to this error being received when trying
to compact and repair, but I can find no information on what to do when it
shows up while trying to open a database.

Can anyone help, please?

Thanks,
Bruce
 
J

Jerry Whittle

You should never attempt to import in any of the MSys tables into a new
database file. Actually they should already be there or will be created when
needed.

Try importing everything else into a new .mdb file EXCEPT for the MSys tables.

At times like this, nothing beats a good backup. In fact make a complete
backup of your database now and put it away for safe keeping.

Tony Toews has an excellent web page on database corruption.
http://www.granite.ab.ca/access/corruptmdbs.htm

Allen Brown also has excellent info on corruption.
http://allenbrowne.com/ser-47.html

I have a white paper in a Word document named Fix Corrupt Access Database
towards the bottom this page:
http://www.rogersaccesslibrary.com/OtherLibraries.asp
 
B

Brucels

Jerry, thank you for your suggestions. I will look at all the links you
provided.

When I try to import ftom the corrupt database, I do not get far enough to
choose what to import. The process stops and gives the error message before I
can choose what to import.

Bruce
 
J

Jerry Whittle

Try Bill's suggestion of using the JetComp utility for repairing the database.

You might try to link to the tables from another database. That way you
might be able to save the data.

Other than that, you probably need to look for the last good backup.
 
T

Tony Toews [MVP]

Brucels said:
Unfortunately, the file was backed up overnight, so the previous
version is not available.

So the IT department can't give you the file from two days ago?
Incredible.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tom Wickerath

Hi Bruce,

Copy the code shown below, and paste it into a new stand-alone module in a
brand new database. Set the value of the constant, BadDBPath, to point to the
database that is corrupt. You *might* have success recovering the tables and
queries with this code, but you'll need to replace indexes and relationships.
This code comes from Access MVP Dirk Goldgar. He just helped me recover a
friend's corrupt database earlier this week. Then run each of the subroutines.

You'll need to recover other objects (forms, reports, macros, modules) from
a backup copy.


Option Compare Database
Option Explicit

' <BadDBPath> is the path to the corrupt database.
Private Const BadDBPath As String = "CompletePathInsertedHere"

Sub GetTables()

On Error GoTo Err_Handler

Dim Robert As DAO.Database
Dim dbBad As DAO.Database
Dim tdf As DAO.TableDef
Dim strSQL As String

Set Robert = CurrentDb
Set dbBad = DBEngine.OpenDatabase( _
BadDBPath, , True)

For Each tdf In dbBad.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
strSQL = _
"SELECT * INTO [" & tdf.Name & "] FROM [" & _
dbBad.Name & "].[" & tdf.Name & "]"
Debug.Print strSQL
Robert.Execute strSQL, dbFailOnError
End If
Next tdf

MsgBox "Done importing tables."

Exit_Point:
On Error Resume Next
dbBad.Close
Exit Sub

Err_Handler:
If MsgBox( _
Err.Description & vbCr & vbCr & "Continue?", _
vbExclamation + vbOKCancel, _
"Error " & Err.Number) _
= vbOK _
Then
Resume Next
Else
Resume Exit_Point
End If

End Sub


Sub GetQueries()

On Error GoTo Err_Handler

Dim dbThis As DAO.Database
Dim dbBad As DAO.Database
Dim qdf As DAO.QueryDef
Dim qdf2 As DAO.QueryDef
Dim strSQL As String

Set dbThis = CurrentDb
Set dbBad = DBEngine.OpenDatabase( _
BadDBPath, , True)

For Each qdf In dbBad.QueryDefs
If Left(qdf.Name, 1) <> "~" Then
Debug.Print qdf.Name, qdf.SQL
Set qdf2 = dbThis.CreateQueryDef(qdf.Name, qdf.SQL)
If Len(qdf.Connect) > 0 Then
qdf2.Connect = qdf.Connect
Debug.Print , "Connect: " & qdf.Connect
End If
Set qdf2 = Nothing
End If
Next qdf

MsgBox "Done importing queries"

Exit_Point:
On Error Resume Next
dbBad.Close
Exit Sub

Err_Handler:
If MsgBox( _
Err.Description & vbCr & vbCr & "Continue?", _
vbExclamation + vbOKCancel, _
"Error " & Err.Number) _
= vbOK _
Then
Resume Next
Else
Resume Exit_Point
End If
End Sub


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
B

Brucels

Thanks to everyone for their advice. After trying a number of the suggestions
with no success, I had to break down and spend money (fortunately, not my
own) for some recovery software, which worked pretty well, although not all
of the queries survived.

The main thing I have learned from this exercise is that I need to set up a
different system for backing up this database (which I developed and maintain
for an organization to which I belong). I have implemented a daily backup
procedure which will keep each day's version, rather than overwriting the
previous day's backup with the current one.

Best,
Bruce
 
B

Bill Mosca

Excellent idea, Bruce. Our IT department keeps daily backups for a week on
my Access databases which is more than long enough. My SQL Server databases
have at least a month's worth of backups should the need arise.

It really surprises me that your guys overwrite everything nightly. I've
never worked in a place that did that.
 
B

Brucels

I can't blame it on an IT department, Bill, since this is work I do on my
home computer on a volunteer basis.

Bruce
 
B

Brucels

Thanks for the davice, Bill. I am already using Karen's Replicator, which I
like for its simplicity. I added a job which backs up this particular
database every night, but does not overwrite the previous version. From time
to time, I will have to clean out older versions, but at least I will always
have a previous version to go back to to. I now need to review what other
files need to have the same type of backup.

Bruce
 
V

Vish

Hi,

Thats good your problem has been solved. I would like to suggest a access
repair software for future use. If anytime your access database get corrupted
or mdb file damaged then you can repair it with the help of stellar phoenix
access recovery software. This software is able to repair forms, modules,
macros, query, tables etc. You can download demo version from here:
http://www.repair-access-file.com

Thanks
 
T

Tony Toews [MVP]

Vish said:
Thats good your problem has been solved. I would like to suggest a access
repair software for future use. If anytime your access database get corrupted
or mdb file damaged then you can repair it with the help of stellar phoenix
access recovery software. This software is able to repair forms, modules,
macros, query, tables etc. You can download demo version from here:

You are an employee of the company mentioned in that URL. Please be
honest about your affiliation.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top