| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 403 人关注过本帖
标题:一段程序 请人帮找下错误
只看楼主 加入收藏
x103133246
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-10-28
收藏
 问题点数:0 回复次数:7 
一段程序 请人帮找下错误

以下是一段程序,运行的时候提示:错误的参数号或无效的属性赋值.
找了半天还以为是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

2007-11-08 23:26
zhangjian110
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2007-10-7
收藏
得分:0 
太难了。。还没有达到这个水平
只是路过看下
2007-11-10 13:39
滴滴雨
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-11-9
收藏
得分:0 

难!!!

2007-11-10 14:15
x103133246
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-10-28
收藏
得分:0 
回复:(滴滴雨)难!!!

这段程序我改了一下。..
但是好象是是在
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
中的Recordset有错...


Private Sub Comfind_Click() '查询统计商品销售信息
If Check1.Value = 0 And Check2.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.Text & "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.Value = 1 And Check2.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.Value = 1 And Check2.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

2007-11-10 14:53
abble
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-11-3
收藏
得分:0 
以下是引用滴滴雨在2007-11-10 14:15:09的发言:

难!!!


2007-11-10 16:26
runsisi
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-11-10
收藏
得分:0 
我晕和数据库结合的 完全不懂 呵呵
2007-11-10 21:18
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:0 

数据库这部分倒看懂了


倚天照海花无数,流水高山心自知。
2007-11-10 21:59
yzh7271
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-11-5
收藏
得分:0 
这是VB程序,不是C语言.

2007-11-11 18:05
快速回复:一段程序 请人帮找下错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023543 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved