VBA SQL错误 - 没有给出一个或多个参数的值 [英] VBA SQL Error - No value given for one or more parameters

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

问题描述




我是字节的新手,我希望你能帮我解决错误 - 没有给出.Open MySql上出现的一个或多个参数的值代码行。我试图从访问数据库中的查询中提取数据并将其输出到Excel。我认为我使用的字符串MySql肯定有问题(我从访问查询中自动生成的sql代码中取出了大部分内容,并更改了区域之间的日期以使用DateSerial功能)。我可能错过了我需要用代码编写其他代码...


任何帮助都将非常感激。谢谢

Alex

展开 | 选择 | Wrap < span class =codeDivider> | 行号

解决方案

< blockquote>我现在已经弄清楚了错误!但是它没有将任何数据发布到行中的Excel工作表:

展开 | 选择 | Wrap < span class =codeDivider> | 行号


在VBE窗口中,使用菜单单击Debug-> Compile。如果Compile显示为灰色,那是因为项目已经全部编译完毕。


它是一个很大的代码,试图从中解决问题。如果我是你,我会先将它添加到第29行:

展开 | 选择 | Wrap | 行号


嗨谢谢 - 我发现了问题MySql字符串。


但它没有输出信息核心...当我调用命令时没有任何反应:

展开 | Se lect | Wrap | 行号


Hi,

I am new to bytes and I was hoping you could please help me with the Error - No value given for one or more parameters that occurs on the .Open MySql line of code. I m trying to extract data from a query from an access database and output this to Excel. I think there must be something wrong with the string MySql which I have used (I took most of it from the auto-generated sql code in the access query and changed the date between area to use the DateSerial fuction). I may have missed out that I need to code something else with the code...

Any help would be greatly appreciated. thank you
Alex


Expand|Select|Wrap|Line Numbers

解决方案

Hi, I have now figured out the error! However it is not posting any data to the excel sheet in the line:

Expand|Select|Wrap|Line Numbers


In your VBE window, use the menu to click Debug->Compile. If the Compile is grayed out, it is because the project is allready compiled.

Its a big bit of code to try to work sense out of. If I were you I would start by adding this to line 29:

Expand|Select|Wrap|Line Numbers


Hi thank you - I found the problem with the MySql string.

However it is not outputting the info corectly... Nothing happens when I call the command:

Expand|Select|Wrap|Line Numbers


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

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