vb查询,出现“至少有一个没有被制定“
Private Sub cmdfind_Click()Dim sql As String
ZhuCe_XueSheng.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb"
ZhuCe_ = adCmdText
If Option3.Value = True Then
sql = "select * from xueji where xh like'" & Text6.Text & "'"
End If
If Option4.Value = True Then
sql = "select * from xueji where xm like '" & "%" & Trim(Text7.Text) & "%" & "'"
End If
ZhuCe_XueSheng.RecordSource = sql
ZhuCe_XueSheng.Refresh ‘问题指向这里
Set DataGrid1.DataSource = ZhuCe_XueSheng
End Sub