机房收费系统之组合查询
来源:互联网 发布:mac硬盘资料被隐藏 编辑:程序博客网 时间:2024/04/24 23:43
如果提到组合查询大家映入眼帘的是什么,当我刚刚接触到她的时候感觉她很难,因为在做组合查询的时候好多同学都做出来了,做出来以后都说很难,她如“犹抱琵琶半遮面”的美女,让我对她充满了好奇,在师傅第一次验收之后当时我确实做出来了,感觉还洋洋得意,但是当师傅验收的时候,我才注意到一个问题就是我的组合查询并没有做到精确查询当检验到数字的时候,她根本就没有反应,比如卡号控制在0到100以内的时候我才发现我原来并没有把所有的数据进行限制,大于100的数字都出来了,但是我当时并没有注意到这个问题,后来我看了十期连江伟师兄的博客才认识到这个问题,于是对我的代码做到了一个修改,问题出现在我们写的SQL语句根本就不对,我们把数字当成了字符所以特没有办法查出来。
If Combo7.Text = "" Then If IsNumeric(Text1.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" Else txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" End If' txtSQL = "select * from student_Info where " & Trim(FileName(Combo1.Text)) & "" & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" Else If Combo8.Text = "" Then If IsNumeric(Text1.Text) And IsNumeric(Text2.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "" & Text2.Text & "" ElseIf IsNumeric(Text1.Text) And Not IsNumeric(Text2.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'" ElseIf Not IsNumeric(Text1.Text) And IsNumeric(Text2.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "" & Text2.Text & "" Else txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'" End If Else If IsNumeric(Text1.Text) And IsNumeric(Text2.Text) And IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "" & Text2.Text & "" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "" & Text3.Text & "" ElseIf IsNumeric(Text1.Text) And IsNumeric(Text2.Text) And Not IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "" & Text2.Text & "" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "'" & Trim(Text3.Text) & "'" ElseIf IsNumeric(Text1.Text) And Not IsNumeric(Text2.Text) And IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "" & Text3.Text & "" ElseIf IsNumeric(Text1.Text) And Not IsNumeric(Text2.Text) And Not IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "" & Text1.Text & "" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "'" & Trim(Text3.Text) & "'" ElseIf Not IsNumeric(Text1.Text) And IsNumeric(Text2.Text) And IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "" & Text2.Text & "" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "" & Text3.Text & "" ElseIf Not IsNumeric(Text1.Text) And Not IsNumeric(Text2.Text) And IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "" & Text3.Text & "" ElseIf Not IsNumeric(Text1.Text) And IsNumeric(Text2.Text) And Not IsNumeric(Text3.Text) Then txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "" & Text2.Text & "" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "'" & Trim(Text3.Text) & "'" Else txtSQL = "select * from Line_Info where " & Trim(FileName(Combo1.Text)) & Trim(Combo4.Text) & "'" & Trim(Text1.Text) & "'" & Trim(FileName(Combo7.Text)) & " " & Trim(FileName(Combo2.Text)) & Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'" & Trim(FileName(Combo8.Text)) & " " & Trim(FileName(Combo3.Text)) & Trim(Combo6.Text) & "'" & Trim(Text3.Text) & "'" End If End If End If
0 0
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之 组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之—组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统之组合查询
- 机房收费系统(1)之组合查询
- 机房收费系统之组合查询
- 机房收费系统 之 组合查询BUG
- 机房收费系统之组合查询
- 【机房收费系统】之组合查询
- C指针右左法则
- GIT分支管理是一门艺术
- cygwin完全安装步骤方法(组图)
- 【Android】Button实现监听的三种方式
- C++中io库的setstate和clear区别
- 机房收费系统之组合查询
- 内存分配方式
- Type.GetType() 返回null的解决办法
- 图像处理之基本阀值操作
- 按照文件名的数字大小排序文件
- Java反射机制
- shell脚本分析 nginx日志访问次数最多及最耗时的页面(慢查询)
- Boost安装
- Fizz Buzz programming