首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

sql命令未正确结束有关问题

2012-08-07 
sql命令未正确结束问题我的VB程序有以下代码strSQL SELECT * FROM signup _& WHERE year & cm

sql命令未正确结束问题
我的VB程序有以下代码
  strSQL = " SELECT * FROM signup " _
  & " WHERE year = " & cmbYear.Text & " AND cmbissue = '" & cmbIssue.Text & "' "
  OracleIsExist gManager.gconSignUp, gManager.gOraSignUp
  Set tRst = gManager.gconSignUp.Execute(strSQL, , adCmdText)
   
  If tRst.RecordCount < 1 Then
  ——————————
运行后出现ora-00933 sql命令未正确结束问题 请问怎么解~~~~

[解决办法]

VB code
'year是系统保留字,要用方括号括起来strSQL = " SELECT * FROM signup " _  & " WHERE [year] = " & cmbYear.Text & " AND cmbissue = '" & cmbIssue.Text & "' "
[解决办法]
strSQL = " SELECT * FROM signup " _
& " WHERE [year] = " & cmbYear.Text & " AND cmbissue = '" & cmbIssue.Text & "' "

热点排行