Sql server 2008 Access 2003 ADP+SQL server迁移到2008年:数据已添加到数据库中,但不会显示数据

Sql server 2008 Access 2003 ADP+SQL server迁移到2008年:数据已添加到数据库中,但不会显示数据,sql-server-2008,sql-server-2000,ms-access-2003,adp,Sql Server 2008,Sql Server 2000,Ms Access 2003,Adp,我已将SQL server 2000数据库迁移到SQL Express 2008。重新分配角色和权限后,它似乎可以工作,但是在表单+子表单中,向子表单添加新记录时,会显示以下错误消息,尽管该记录仍然添加到基础表中: The data was added to the database but the data won't be displayed in the form because it doesn't satisfy the criteria in the underlying recor

我已将SQL server 2000数据库迁移到SQL Express 2008。重新分配角色和权限后,它似乎可以工作,但是在表单+子表单中,向子表单添加新记录时,会显示以下错误消息,尽管该记录仍然添加到基础表中:

The data was added to the database but the data won't be displayed in the form because it doesn't satisfy the criteria in the underlying record source.

描述了解决此问题的方法,但recordsource是动态创建的;一旦主窗体中的内容发生更改,子窗体中的recordsource属性将相应更改。有没有办法解决这个问题?

根据您链接的文章,您必须创建一个视图,并将记录源指向该视图。因为您没有显示源代码,也没有详细说明动态的含义,所以最好的建议是在SQL数据库中的on INSERT、UPDATE触发器中创建视图

在插入时,更新主表上的触发器。 为该子窗体生成所需的动态视图,为该视图提供一个标准名称,如vwSubForm[PKID],其中[PKID]是该行的主键。 编辑动态记录源代码以指向为子窗体生成的视图。