窗体ADODC和Datagrid 联合查询,给定不同的查询条件显示不同的内容:Private Sub Command1_Click()
Dim Str2 As String
Str2 = App.Path & "\DateBase\DateBase.mdb"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Str2 & ";Persist Security Info=False"Adodc1.RecordSource = "select 编号,姓名 from 员工档案 "
Adodc1.Refresh
End Sub以上可以显示Private Sub Command2_Click()
Dim Str1 As String
Dim Str2 As String
Dim db As Connection
Str1 = Me.Combo2.Text
Str2 = App.Path & "\DateBase\DateBase.mdb"Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Str2 & ";Persist Security Info=False"
Adodc1.RecordSource = "select 编号,姓名 from 员工档案 where 部门类别=' " & Str1 & "'"
Adodc1.Refresh
end sub
提示错误 ADODC1至少缺少一个参数,无法显示。怎么解决?
Dim Str2 As String
Str2 = App.Path & "\DateBase\DateBase.mdb"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Str2 & ";Persist Security Info=False"Adodc1.RecordSource = "select 编号,姓名 from 员工档案 "
Adodc1.Refresh
End Sub以上可以显示Private Sub Command2_Click()
Dim Str1 As String
Dim Str2 As String
Dim db As Connection
Str1 = Me.Combo2.Text
Str2 = App.Path & "\DateBase\DateBase.mdb"Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Str2 & ";Persist Security Info=False"
Adodc1.RecordSource = "select 编号,姓名 from 员工档案 where 部门类别=' " & Str1 & "'"
Adodc1.Refresh
end sub
提示错误 ADODC1至少缺少一个参数,无法显示。怎么解决?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货