Mandelbrotter
Mandelbrotter

Reputation: 2436

How do you recreate an Access DB only keeping records and table structures

I have an Access database (.accdb) that I firmly believe has been corrupted.

Is there a way to recreate the database by transferring/copying over only records and table structures and nothing else? I'm not worried about losing corrupted records.

Reasons why I believe it is corrupted

I can run this on a backup of the database but not on the current version.

Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

*Note: Compact and repair didn't solve this issue.

Upvotes: 0

Views: 109

Answers (2)

BobS
BobS

Reputation: 718

A corrupted database can be a difficult thing to recover from and it can depend on how severe the corruption is. If you only want the records and table structures and are not worried about losing corrupted records then maybe restoring from a recent backup may be your easiest option. One thing you can try is linking to the tables using another Access database. Just create a new empty database and then go to the External Data tab and select Access. Then browse to your corrupted database and select that. Next select the "Link to the data source by creating a linked table" option and click Ok. Hopefully you will then be presented with a list of tables you can link to. Select All and cross your fingers. If the links are successful then you may be able to manually copy each table into your new database.

Just as a point of interest, I always use a backend database that contains nothing but tables and I have a frontend database which contains all my forms, queries, reports, modules, etc and only links to the tables in the backend database. This effectively separates the data from the code. In my experience, 99% of corruption is caused when you have both the application and your data in the one database. Good luck!

Upvotes: 0

Albert D. Kallal
Albert D. Kallal

Reputation: 49039

Create a blank new fresh database.

then use external data table.

You have/get/see this:

enter image description here

Or slightly older versions, use this:

enter image description here

Now import all of the tables. It will leave everything else behind.

so, you can select all tables from this tab:

enter image description here

This will of course leave behind any damaged forms, code etc., and you wind up with a fresh "data only" copy of the data.

Upvotes: 1

Related Questions