运行时错误'3061'.参数太少.预期1.(Access 2007) [英] Run-time error '3061'. Too few parameters. Expected 1. (Access 2007)
问题描述
我有以下'set recordset'
行,我无法正常工作.根据我可以找到的有关该主题的所有可用帮助,这些参数似乎是正确的.
I have the following 'set recordset'
line that I cannot get working. The parameters seem correct according to all available help I can find on the subject.
错误显示:
运行时错误'3061'.参数太少.预期为1."
"Run-time error '3061'. Too few parameters. Expected 1."
这是代码行:
Set rs = dbs.OpenRecordset("SELECT Centre_X, Centre_Y FROM [qry_all_details]
WHERE ID = " & siteID & ";", dbOpenSnapshot)
Where rs is the recordset (Dim rs As Recordset) and dbs = CurrentDb()
任何帮助将不胜感激.
我试图消除WHERE
原因,但没有任何效果,并且还在双引号之间使用了单引号,但没有任何乐趣.
I have tried removing the WHERE
cause with no effect, and also using single quotes between double quotes, but no joy.
非常感谢.
推荐答案
运行时错误'3061'.参数太少.期望值为1."
"Run-time error '3061'. Too few parameters. Expected 1."
我相信,当您的sql查询中的字段名称与表的字段名称不匹配时,即查询中的字段名称错误或表可能完全缺少该字段时,就会发生这种情况.
I believe this happens when the field name(s) in your sql query do not match the table field name(s), i.e. a field name in the query is wrong or perhaps the table is missing the field altogether.
这篇关于运行时错误'3061'.参数太少.预期1.(Access 2007)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!