VB 对象'Refresh'的方法'IAdodc'失败 40
PrivateSubCommand1_Click()DimconditionAsStringIfCheck1.Value=1ThenIfcondition=""Thenc...
Private Sub Command1_Click()
Dim condition As String
If Check1.Value = 1 Then
If condition = "" Then
condition = "Cm_Name='" & Text1.Text & " '"
Else
condition = condition & "and Cm_Name ='" & Text1.Text & " '"
End If
End If
If Check2.Value = 1 Then
If condition = "" Then
condition = "Add_number like '%" & Text2.Text & "% '"
Else
condition = condition & "and Add_number like '%" & Text2.Text & "% '"
End If
End If
If Check1.Value = 0 And Check2.Value = 0 Then
MsgBox "请选择查询条件", vbOKOnly, "警告"
Exit Sub
End If
Adodc1.RecordSource = "select * from com_info where " & condition
Adodc1.Refresh
Text1.Text = ""
Text2.Text = ""
Check1.Value = 0
Check2.Value = 0
End Sub
对选择的项目查询 出现如标题错误 请回答
adodc1已经连上数据库了 DATGIRD都可以显示数据库数据 展开
Dim condition As String
If Check1.Value = 1 Then
If condition = "" Then
condition = "Cm_Name='" & Text1.Text & " '"
Else
condition = condition & "and Cm_Name ='" & Text1.Text & " '"
End If
End If
If Check2.Value = 1 Then
If condition = "" Then
condition = "Add_number like '%" & Text2.Text & "% '"
Else
condition = condition & "and Add_number like '%" & Text2.Text & "% '"
End If
End If
If Check1.Value = 0 And Check2.Value = 0 Then
MsgBox "请选择查询条件", vbOKOnly, "警告"
Exit Sub
End If
Adodc1.RecordSource = "select * from com_info where " & condition
Adodc1.Refresh
Text1.Text = ""
Text2.Text = ""
Check1.Value = 0
Check2.Value = 0
End Sub
对选择的项目查询 出现如标题错误 请回答
adodc1已经连上数据库了 DATGIRD都可以显示数据库数据 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询