[求助]关于数据库查询的问题,急助
Private Sub CmdSearch_Click()Dim searchSQL As String
If TextSerCondition <> "" Then
If Option1(0).Value Then
searchSQL = "select * from works where work_id='" & Trim(TextSerCondition.Text) & "'"
If Option1(1).Value Then
searchSQL = "select * from works where name='" & Trim(TextSerCondition.Text) & "'"
If Option1(2).Value Then
searchSQL = "select * from works where section='" & Trim(TextSerCondition.Text) & "'"
If Option1(3).Value Then
searchSQL = "select * from works where faculty='" & Trim(TextSerCondition.Text) & "'"
End If
End If
End If
End If
Adodc3.RecordSource = searchSQL
Adodc3.Refresh
End If
End Sub
第一个Option是对号码(数字)查询,查询正确。但后三个是对文字信息进行查询的,但都不能得到正确结果,我是把查询得到的结果放到Adodc3所连接的DataGrid中显示的,求大侠帮助。