英文:
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.
英文:
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.
答案1
得分: 1
创建一个全新的空白数据库。
然后使用外部数据表。
您会看到以下内容:
或者稍旧的版本,可以使用以下内容:
现在导入所有的表格。这将保留其他所有内容。
因此,您可以从此选项卡中选择所有表格:
这当然会保留任何损坏的表单、代码等内容,最终您将获得一个全新的“仅数据”副本。
英文:
Create a blank new fresh database.
then use external data table.
You have/get/see this:
Or slightly older versions, use this:
Now import all of the tables. It will leave everything else behind.
so, you can select all tables from this tab:
This will of course leave behind any damaged forms, code etc., and you wind up with a fresh "data only" copy of the data.
答案2
得分: 0
一个损坏的数据库可能很难恢复,这取决于损坏的程度。如果您只想要记录和表结构,并且不担心丢失已损坏的记录,那么从最近的备份中恢复可能是最简单的选择。您可以尝试的一种方法是使用另一个Access数据库来链接表格。只需创建一个新的空数据库,然后转到“外部数据”选项卡,选择“Access”。然后浏览到您损坏的数据库并选择它。接下来选择“通过创建链接表链接到数据源”选项,然后点击确定。希望您会看到一个可以链接的表格列表。选择全部并祈祷吧。如果链接成功,然后您可以尝试手动复制每个表格到您的新数据库中。
作为一个有趣的观点,我总是使用一个后端数据库,其中只包含表格,然后有一个前端数据库,其中包含所有的表单、查询、报告、模块等,并且只链接到后端数据库中的表格。这有效地将数据与代码分离。根据我的经验,99%的损坏是在应用程序和数据都在同一个数据库中时引起的。祝好运!
英文:
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!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论