Private Sub Command1_Click(Index As Integer)
Dim sql As String
If Check1.Value = vbChecked Then
sql = "书名" & Trim(Text1.Text & " ") & "'"
End If
If Check2.Value = vbcheckde Then
If Trim(sql) = "" Then
sql = "类别='" & Trim(Combo1.Text & " ") & "'"
Else
sql = sql & "and 书名='" & Trim(Combo1.Text & "'") & "'"
End If
End If
If Check3.Value = vbcheckde Then
If Trim(sql) = "" Then
sql = "作者='" & Trim(Text2.Text & " ") & "'"
Else
sql = sql & "and 作者='" & Trim(Text2.Text & " ") & "'"
End If
End If
If Check4.Value = vbChecked Then
If Trim(sql) = "" Then
sql = "出版社='" & Trim(Text3.Text & " ") & "'"
Else
sql = sql & "and 出版社='" & Trim(Text3.Text & " ") & "'"
End If
End If
If Check5.Value = vbChecked Then
If Trim(sql) = "" Then
sql = "书籍编号='" & Trim(Text4.Text & " ") & "'"
Else
sql = sql & "and 书籍编号='" & Trim(Text4.Text & " ") & "'"
End If
End If
If Trim(sql) = " " Then
MsgBox "请选择查询方式!", vbOKOnly + vbExclamation
Exit Sub
End If
Adodc1.RecordSource = "select * from sjxx where " & sql
Adodc1.Refresh 就是这句错误,不知道怎么改啊。
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub
提示FROM子语法错误,Adodc1.Refresh不能实现。在线等。小妹谢谢了