2016-11-07 291 views
0

我试图打开报告时遇到此错误。Microsoft Access 2016 - 记录源不存在

The record source '~sq_dProduct Summary~sq_dOLEUnbound0' specified on this form or report does not exist. 

The name of the recordsource may be misspelled, the recordsource was deleted or renamed, or the recordsource exists in a different database. 

In the Form or Report's Design view or Layout view, display the property sheet by clicking the Properties button, and then set the RecordSource property to an existing table or query. 

它变成了一个空白的“打印预览”报告。但是当我右键点击报告并转到“设计视图”时,里面就有数据。我不知道什么是错的。任何人都可以帮忙吗?

回答

0

这是命名约定Access用于在幕后创建查询,当您在窗体/报表的设计视图中使用构建器按钮设置RecordSource属性时。当您按下构建器按钮时,您将看到一个QBE窗口(按示例查询)。当您保存表单或报表时,Access会创建此查询,将其隐藏在数据库容器中,并在内部使用它,尽管您可以在RecordSource属性中看到实际的SQL。这就是为什么它从设计角度看起来有效。

问题是数据库引擎不能再找到这个“缓存”的隐藏查询。

我想:

  • 复制形式或RecordSource属性报告到一个文本文件。
  • 删除报告RecordSource修复并压缩数据库
  • 重新打开报告并再次粘贴到记录源中。

如果您正在使用的子窗体,组合框,列表框等也可能有记录来源属性,你应该做同样的,直到你找到罪魁祸首。换句话说,在报表/窗体设计的任何地方,您都会看到一个RecordSource属性,该属性具有一个SQL语句作为RecordSource属性的值。

解决它的一个好方法是创建一个普通查询,然后将所有窗体/报表/控件的RecordSource属性设置为该永久Access对象。