毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

VB电表管理信息系统 第12页

更新时间:2010-4-5:  来源:毕业论文
VB电表管理信息系统 第12页
数据查询代码设计:
Private Sub cmdExport_Click()
'导出网格数据到EXCEL中
    Export rsdg, Me.dgexp, " 数据查询", "日期:" & Format(Now, "yyyy-mm-dd"), "   总电量:" & txtCountA & " 度  总金额:" & txtCount & " 元"
End Sub

Private Sub cmdQuery_Click()
Dim Sqlstr As String
Dim whrStr As String
Dim feeC As Double
Dim znjC As Double

Dim rstRg As New ADODB.Recordset
'拼Where 语句
whrStr = getWhrStr()
'取得网格的数据
 Sqlstr = "select * from  feels   " & whrStr & " "
 'MsgBox Sqlstr
If rsdg.State = 1 Then
   rsdg.Close
End If
rsdg.Open Sqlstr, gCnn, adOpenStatic, adLockOptimistic
'Debug.Print Sqlstr
Set rsdg = getQueryData(Sqlstr)
Set dgexp.DataSource = rsdg

Sqlstr = " select  sum(feeMoney),sum(Ecount) from feels " & whrStr & " "
If rstRg.State = 1 Then
   rstRg.Close
End If
rstRg.Open Sqlstr, gCnn, adOpenStatic, adLockBatchOptimistic
txtCount = Format(rstRg.Fields(0), "####0.00") & " "
txtCountA = rstRg.Fields(1) & " "
rstRg.Close

MsgBox " 数据查询完成,共" & rsdg.RecordCount & " 条纪录!", vbInformation

End Sub
Private Function getWhrStr() As String
'功能描述:拼凑Where语句
'返回串值
Dim whrStr As String
'拼Where 语句
whrStr = "where 1 = 1 "
If Trim(Me.txtID) <> "" Then
    whrStr = whrStr & " and  holderid ='" & Trim(Me.txtID) & "' "
End If

If Trim(Me.txtUser) <> "" Then
    whrStr = whrStr + " and   holder like '%" & txtUser & "%'"
End If
If Trim(Me.txtMoney) <> "" Then
    whrStr = whrStr + " and qianFee>= " & Me.txtMoney & ""
End If
whrStr = whrStr + " and Feedate>= #" & Me.dtpS & "#  and Feedate<= #" & Me.dtpE & "# "
getWhrStr = whrStr

End Function
Private Sub cmdReturn_Click()
Unload Me
End Sub

Private Sub Form_Load()
dtpE.Value = Format(Now, "yyyy-mm-dd")
End Sub

Private Sub Form_Unload(Cancel As Integer)

If rsdg.State = 1 Then
rsdg.Close
End If
End Sub

11:费用查询界面设计:
费用查询代码设计:
Private Sub cmdExport_Click()
'导出网格数据到EXCEL中
    Export rsdg, Me.dgexp, " 数据查询", Format(Now, "yyyy-mm-dd")
End Sub

Private Sub cmdQuery_Click()
Dim Sqlstr As String
Dim whrStr As String
Dim feeC As Double
Dim znjC As Double

'拼Where 语句
whrStr = getWhrStr()
'取得网格的数据 '2957387
 Sqlstr = "select * from  panelInfo  " & whrStr & " "
 'MsgBox Sqlstr
 If rsdg.State = 1 Then
    rsdg.Close
 End If
rsdg.Open Sqlstr, gCnn, adOpenStatic, adLockOptimistic
Set rsdg = getQueryData(Sqlstr)
Set dgexp.DataSource = rsdg
MsgBox " 数据查询完成,共" & rsdg.RecordCount & " 条纪录!", vbInformation
End Sub
Private Function getWhrStr() As String
'功能描述:拼凑Where语句
'返回串值
Dim whrStr As String
'拼Where 语句
whrStr = "where 1 = 1 "
If Trim(Me.txtID) <> "" Then
    whrStr = whrStr & " and  holderid ='" & Trim(Me.txtID) & "' "
End If

If Trim(Me.txtUser) <> "" Then
    whrStr = whrStr + " and   holder like '%" & txtUser & "%'"
End If
If Trim(Me.txtMoney) <> "" Then
    whrStr = whrStr + " and cFeeMoney>= " & Me.txtMoney & ""
End If
getWhrStr = whrStr

End Function
Private Sub cmdReturn_Click()
Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
If rsdg.State = 1 Then
rsdg.Close
End If
End Sub

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页

VB电表管理信息系统 第12页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。