WHERE子句中具有多个条件的SQL语句的语法

WHERE子句中具有多个条件的SQL语句的语法,sql,ms-access,vba,ms-access-2010,Sql,Ms Access,Vba,Ms Access 2010,我在下面的SQL字符串中遇到运行时3075问题。我是否可能缺少括号 sql_get = "SELECT [tblCompetency02].[HighLevelObjective], [tblCompetency04].[Self], [tblCompetency04].[SelfSpecialLanguage], [tblCompetency04].[SelfChecklist], [tblCompetency04].[Team], [tblCompetency04].[T

我在下面的SQL字符串中遇到运行时3075问题。我是否可能缺少括号

    sql_get = 
"SELECT [tblCompetency02].[HighLevelObjective], 
[tblCompetency04].[Self], 
[tblCompetency04].[SelfSpecialLanguage], 
[tblCompetency04].[SelfChecklist], 
[tblCompetency04].[Team], 
[tblCompetency04].[TeamSpecialLanguage], 
[tblCompetency04].[TeamChecklist],
 [tblCompetency04].[Organisation],
 [tblCompetency04].[OrganisationSpecialLanguage], 
[tblCompetency04].[OrganisationChecklist],
 [tblCompetency02].[Competency] 
FROM [tblCompetency04] 
INNER JOIN [tblCompetency02] 
ON [tblCompetency04].[HighLevelObjective] = [tblCompetency02].[ID] 
WHERE [tblcompetency04].[self]<>"" or [tblcompetency04].[team]<>"" or [tblcompetency04].[organisation]<>"""
        Form_frmStaticDataSkills02.Form.RecordSource = sql_get
sql\u get=
“选择[TBLCompency02]。[HighLevelObjective],
[tblCompetency04]。[Self],
[TBLCompency04]。[SelfSpecialLanguage],
[tblCompetency04]。[Self Checklist],
[TBLCompency04]。[团队],
[TBLCompency04][TeamSpecialLanguage],
[tblCompetency04]。[TeamChecklist],
[tblCompetency04]。[Organization],
[TBLCompency04]。[OrganizationSpecialLanguage],
[tblCompetency04]。[OrganizationChecklist],
[tblCompetency02]。[能力]
来自[TBLCompency04]
内部联接[TBLCompency02]
在[TBLCompency04].[HighLevelObjective]=[TBLCompency02].[ID]上
其中[TBLCompency04].[self]''或[TBLCompency04].[team]''或[TBLCompency04].[organization]''
Form\u frmstaticataskills02.Form.RecordSource=sql\u get

检查代码创建的语句的
WHERE
子句

下面是一个即时窗口会话:

sql_get=“WHERE[TBLCompency04].[self]”或[TBLCompency04].[team]”或[TBLCompency04].[organization]”
调试。打印sql\u获取
其中[TBLCompency04].[self].“或[TBLCompency04].[team]”或[TBLCompency04].[organization]”
请注意,每种情况下只有一个双引号字符:

如果您想在字符串中使用双引号,请使用两个引号获得一个

sql\u get=“WHERE[TBLCompency04].[self]”或[TBLCompency04].[team]”或[TBLCompency04].[organization]”
调试。打印sql\u获取
其中[TBLCompency04].[self]''或[TBLCompency04].[team]''或[TBLCompency04].[organization]''
但我认为在字符串中使用单引号比较容易混淆和出错

sql_get=“其中[TBLCompency04].[self]''或[TBLCompency04].[team]''或[TBLCompency04].[organization]''
调试。打印sql\u获取
其中,[TBLCompency04].[self]''或[TBLCompency04].[team]''或[TBLCompency04].[organization]''
试试sql_get=@“选择………..”;因为在查询中有双引号,它将失败..如果使用@它将很好..测试并告诉