比较运算符语法 [英] Comparison operator Syntax

查看:80
本文介绍了比较运算符语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。 Ps感谢所有的帮助让我到目前为止。我在click事件的以下代码中得到3075语法错误(缺少运算符)。在添加硬盘标准之前,代码工作正常。这段代码有什么问题,或者我应该采取不同的方法。这个想法是,如果硬盘驱动器是低规格,它将返回数据库中小于120的所有记录

Hi there again folks. Ps thanks for all the help gettin me this far. I get an 3075 syntax error (missing operator) in the following code of the click event. The code worked fine before i added the harddrive criteria. Is there something wrong with this bit of code or should i be taking a different approach. The idea is that if the hardrive is low spec it will return all the records smaller than 120 in the database

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

推荐答案

您好panteraboy:


您是在编译时还是在执行期间收到此错误消息?


我把你的代码放入我的数据库中的一个模块中,在你定义了SQL语句,编译它并逐步完成它之后插入了一个 Debug.Print strSQL (我硬编码了你的查询值)。立即窗口中输出的SQL语句如下:

Hi panteraboy:

Do you get this error message at compile time, or during execution?

I put your code into a module in my db, inserted a Debug.Print strSQL right after you defined the SQL statement, compiled it, and stepped through it (I hardcoded your query values). The SQL statement outputted in the Immediate Window as follows:

展开 | 选择 | Wrap | 行号


嗨Pat,是的,它发生在运行中我点击提交按钮后的时间。

一整天都在我头脑中大声笑。可以认为它是错误的。 。它说在查询表达式中缺少运算符,但是如果缺少运算符,SQL代码将在代码窗口中以红色突出显示。它是一个奇怪的一个,但感谢你的帮助无论如何

问候panteraboy
Hi Pat, yes it happens at run time right after i click on the submit button.
Its sort of been doin my head in all day lol. Can think what it is im doin wrong. . Its saying missing operator in query expression but surely if there was a missing operator the SQL code would be highlighted in red in the Code window. Its a strange One but thanks for the help anyway
Regards panteraboy



嗨Pat,是的,它发生在我点击提交按钮后立即运行时间。

一整天都在我脑海中大声笑。可以认为它是错误的。 。它说在查询表达式中缺少运算符,但是如果缺少运算符,SQL代码将在代码窗口中以红色突出显示。它是一个奇怪的一个,但感谢你的帮助无论如何

问候panteraboy
Hi Pat, yes it happens at run time right after i click on the submit button.
Its sort of been doin my head in all day lol. Can think what it is im doin wrong. . Its saying missing operator in query expression but surely if there was a missing operator the SQL code would be highlighted in red in the Code window. Its a strange One but thanks for the help anyway
Regards panteraboy



嗯,根据我自己的经验,每当有问题使用SQL代码本身的语法,它不会停留在strSQL(因为strSQL只是一个字符串定义 - 你可以把任何你想要的东西放在一个字符串中)。相反,它将停止在实际执行SQL语句的位置。


如果在ORDER BY前放置一个空格是不行的,那么你有...> = 120 ORDER BY而不是> = 120ORDER BY(我' '设置硬盘= 120),不确定它是什么......


Pat

Well, in my own experience, whenever there''s an issue with the syntax of the SQL code itself, it doesn''t stop at strSQL (because strSQL is merely a string definition - you can put anything you want in a string). Rather, it will stop at the point where the SQL statement is actually executed.

If putting a space in front of ORDER BY isn''t working, so that you have ... >= 120 ORDER BY instead of >=120ORDER BY (I''ve set harddrive =120), not sure what it could be...

Pat


这篇关于比较运算符语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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