以下是一段程序,运行的时候提示:错误的参数号或无效的属性赋值.
找了半天还以为是SQL中的数据类型错了.但是仔细看看没错.....
等待好心人帮下.......
Private Sub Comfind_Click() '查询统计商品销售信息
If Check1(0).Value = 0 And Check1(1).Value = 1 Then
Select Case Combo2.Text
Case Is = "like'"
Adodc1.RecordSource = "select* from 综合查询表 where(综合查询表." & Combo1.Text & " like'%'+'" + Text1.Text + "'+'%')"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz,sum(数量)as 数量1,sum(金额)as 金额1 from 综合查询表 where(综合查询表." & Combo1.Text1 & "like+'%'+'" + Text1.Text + "'+'%')"
Adodc2.Refresh
Case Is = "="
Adodc1.RecordSource = "select*from 综合查询表 where (综合查询表." & Combo1.Text & "='" + Text1.Text + "')"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz,sum(数量)as 数量1,sum(金额)as 金额1 from 综合查询表 where(综合查询表." & Combo1.Text1 & "='" + Text1.Text + "')"
Adodc2.Refresh
End Select
End If
If Check1(0).Value = 1 And Check1(1).Value = 0 Then
Adodc1.RecordSource = "select*from 综合查询表 where 综合查询表.日期 between'" + Str(dtp1.Value) + "'AND'" + Str(dtp2.Value) + "'"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz,sum(数量)as 数量1,sum(金额)as 金额1 from 综合查询表 where 综合查询表.日期 between'" + Str(dtp1.Value) + "'AND'" + Str(dtp2.Value) + "'"
Adodc2.Refresh
End If
If Check1(0).Value = 1 And Check1(1).Value = 1 Then
Select Case Combo2.Text
Case Is = "like"
Adodc1.RecordSource = "select*from 综合查询表 where(综合查询表." & Combo1.Text & " like'%'+'" + Text1.Text + "'+'%'and 综合查询表.日期 between'" + Str(dtp1.Value) + "'AND'" + Str(dtp2.Value) + "')'"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz,sum(数量)as 数量1,sum(金额)as 金额1 from 综合查询表 where (综合查询表." & Combo1.Text & "like +'%'+'" + Text1.Text + " '+'% 'and 综合查询表.日期 between'" + Str(dtp1.Value) + "'AND'" + Str(dtp2.Value) + "')"
Adodc2.Refresh
Case Is = "="
Adodc1.RecordSource = "select*from 综合查询表 where (综合查询表." & Combo1.Text & "='" + Text1.Text + "'and 综合查询表.日期 between'" + Str(dtp1.Value) + "'AND'" + Str(dtp2.Value) + "')"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as pz sum(数量)as 数量1,sum(金额)as 金额1 from 综合查询表 where (综合查询表." & Combo1.Text & " ='" + Text1.Text + "'and 综合查询表.日期 between'" + Str(dtp1.Value) + "'AND'" + Str(dtp2.Value) + "')"
Adodc2.Refresh
End Select
End If
If Adodc2.Recordset.Fields(0) <> "" Then Labpz.Caption = Adodc2.Recordset.Fields(0) Else
Labpz.Caption = 0
If Adodc2.Recordset.Fields(1) <> "" Then Labsl.Caption = Adodc2.Recordset.Fields(1) Else
Labsl.Caption = 0
If Adodc2.Recordset.Fields(2) <> "" Then Labje Caption = Format(Adodc2.Recordset.Fields(2), "0.00") Else Labje.Caption = "0.00"
End Sub