错误:没有给出一个或多个必需参数的值 [英] Error: no value given for one or more required parameters

查看:306
本文介绍了错误:没有给出一个或多个必需参数的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试更新旧的vb6项目,我尝试运行的查询在Access查询构建器上运行时工作正常,但是当我复制同一个查询并尝试在vb6中运行时,它显示错误错误:没有值给出一个或多个必需参数



我的查询是:

Trying to update an old vb6 project, the query i am trying to run is working correctly when run on Access query builder, but when i copy this same query and try to run within vb6 it showing me error "error: no value given for one or more required parameters"

My query is:

rs_store.Open ("SELECT store_exp.type, Sum(store_exp.amount) AS SumOfamount, First(store_exp.[amt type]) AS [FirstOfamt type] From store_exp GROUP BY store_exp.type"), cn





我尝试过:



在访问查询构建器中正常工作。



What I have tried:

working correctly in access query builder.

推荐答案

删除括号

Either remove the parentheses
rs_store.Open "SELECT store_exp.type, Sum(store_exp.amount) AS SumOfamount, First(store_exp.[amt type]) AS [FirstOfamt type] From store_exp GROUP BY store_exp.type", cn

或传递所有参数,包括括号括起来的可选参数:

or pass all parameters including the optional ones enclosed by parentheses:

rs_store.Open("SELECT store_exp.type, Sum(store_exp.amount) AS SumOfamount, First(store_exp.[amt type]) AS [FirstOfamt type] From store_exp GROUP BY store_exp.type", cn, adOpenForwardOnly)


这篇关于错误:没有给出一个或多个必需参数的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆