问题描述
我经常在.adp中使用类似于以下内容的代码在Load事件中设置表单的记录源:
I frequently use code similar to the following in an .adp to set a form's recordsource in the Load event:
Me.InputParameters =" @prmInteger =" ; &安培; Me.cboValue     '根据组合框的值设置参数
Me.Recordsource =" dbo.procParameterized"            '该过程接受一个整数参数
Me.InputParameters = "@prmInteger = " & Me.cboValue 'set the parameter based on the value of a combo box
Me.Recordsource = "dbo.procParameterized" 'the procedure accepts a single integer parameter
此代码到目前为止工作正常(Access 2010与SQL Server 2005交谈)。应用Office 2010 SP 1后,代码不再有效 - 当Access访问第二行时,它会从用户请求参数,就好像它在代码中没有提供
一样。在尚未应用SP的客户端上的SQL跟踪显示服务器运行包含传递参数的executeSQL语句,但是具有SP的系统上的跟踪从不运行executeSQL语句(它根本不显示)跟踪中的
。
This code has worked fine up until now (Access 2010 talking to SQL Server 2005). After applying Office 2010 SP 1, the code no longer works--when Access hits the second line, it requests the parameter from the user as if it hasn't been supplied in the code. A SQL trace on a client where the SP hasn't been applied shows the server running an executeSQL statement that includes the passed parameter, but a trace on a system with the SP never runs the executeSQL statement (it doesn't appear at all in the trace).
删除SP修复了问题,重新应用它会重新创建问题。 我可以通过避免使用InputParameters / Recordsource技术并打开记录集并将其分配给表单的记录集来解决此问题,但这将涉及大量
的重新编码量。 Sooooo ......改变了什么,为什么?
Removing the SP fixes the problem, and re-applying it re-creates it. I can work around this problem by avoiding the InputParameters/Recordsource technique and opening a recordset and assigning it to the form's recordset, but that would involve a large amount of re-coding. Sooooo... what changed and why?
推荐答案
没有想知道这是不是一个真正的错误。如果我们添加这些已经检测到的我们
可以等待其他奇怪的东西,意外的将是在不久的将来找到。
there will be no wonder if it is a real bug. And if we add these already detected http://blog.nkadesign.com/2011/office-2010-sp1-and-access-2010-runtime-sp1-are-broken/ we can wait for something else strange and unexpected will be found in the nearest future.
这篇关于Office 2010 SP 1打破代码...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!