为什么vb里,在成绩那输入90后进行模糊查询,总是出现字符串90%前有未闭合引导
if txtGrade.Text <> "" Then
If chkMoHu.Value = 1 Then
strCon(5) = "SC.grade like '" & txtGrade.Text & "%"
Else
strCon(5) = "SC.grade ='" & txtGrade.Text & "'"
End If
Else
strCon(5) = ""
End If
strSQL = "select SC.Sno,Student.Sname,SC.Cno," _
& " Course.Cname,SC.grade from SC,Student,Course " _
& " where SC.sno=Student.sno and SC.Cno=Course.Cno "
For i = 1 To 5
If strCon(i) <> "" Then
strSQL = strSQL + " and " + strCon(i)
End If
Next
Adodc1.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ST;Initial Catalog=S-T"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = strSQL
[b]Adodc1.Refresh
调试后显示出错在adodc1.refresh这块,你能帮我看下哪里有问题吗?谢谢