ms-access:如何评论sql代码?

时间:2022-11-08 11:48:08

is it possible to comment code out in the sql window in access?

是否有可能在访问的SQL窗口中注释代码?

2 个解决方案

#1


4  

No. You cannot have any extraneous text in MS-Access (JET-SQL).

不可以。在MS-Access(JET-SQL)中不能有任何无关的文本。

You can make some constraints ignored, eg.

你可以忽略一些约束,例如。

Where 
name = "joe"
OR
(state = "VA" AND 1=0)

But that technique is a rather limited way to hide existing SQL

但是这种技术是隐藏现有SQL的一种相当有限的方法

#2


4  

As MathewMartin said, you can't. I use the following workaround:

正如MathewMartin所说,你做不到。我使用以下解决方法:

SELECT * FROM x
WHERE "-- your comment. This plain string is always true";

or

SELECT * FROM x
WHERE y = 'something'
AND " -- z = 'something else' ";

#1


4  

No. You cannot have any extraneous text in MS-Access (JET-SQL).

不可以。在MS-Access(JET-SQL)中不能有任何无关的文本。

You can make some constraints ignored, eg.

你可以忽略一些约束,例如。

Where 
name = "joe"
OR
(state = "VA" AND 1=0)

But that technique is a rather limited way to hide existing SQL

但是这种技术是隐藏现有SQL的一种相当有限的方法

#2


4  

As MathewMartin said, you can't. I use the following workaround:

正如MathewMartin所说,你做不到。我使用以下解决方法:

SELECT * FROM x
WHERE "-- your comment. This plain string is always true";

or

SELECT * FROM x
WHERE y = 'something'
AND " -- z = 'something else' ";