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

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

更新时间:2010-4-5:  来源:毕业论文
VB电表管理信息系统 第19页
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
dy
End Sub
Private Sub Form_Unload(Cancel As Integer)
If gCnn.State = 0 Then
 gCnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= " & DbPassword & " ;Data Source= " & _
    App.Path & "\data\dbdb.mdb;Persist Security Info=False"
    gCnn.CursorLocation = adUseClient
    gCnn.Open
End If
MDIme.loadAdd
End Sub5. 单户抄表界面设计:
单户抄表代码设计:
Private Sub Command2_Click()
    Dim cnn As New ADODB.Connection
    Dim rstE As New ADODB.Recordset
    Dim cmdExe As New ADODB.Command
    Dim nowEv As Double
    Dim sqlAdd As String
    If Trim(txtUserName(0).Text) = "" Then
       MsgBox " 没有要抄表用户,请先添加用户!   ", vbInformation
       Exit Sub
    End If
    If Trim(txtUserName(9).Text) = "" Then
       MsgBox " 请先输入数据!   ", vbInformation
       Exit Sub
    End If   
    If Trim(txtUserName(9).Text) < Trim(txtUserName(2).Text) Then
       MsgBox " 输入数据错误,当前止码太小!   ", vbInformation
       Exit Sub
    End If
    cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= " & DbPassword & " ;Data Source= " & _
    App.Path & "\data\dbdb.mdb;Persist Security Info=False"
    cnn.CursorLocation = adUseClient
    cnn.Open
    cmdExe.ActiveConnection = cnn
    rstE.Open "select nowecount from panelinfo where  holderID= '" & Trim(txtUserName(0)) & "'", cnn, adOpenStatic, adLockBatchOptimistic   
    nowEv = Val(rstE.Fields(0).Value) + (Val(txtUserName(9)) - Val(txtUserName(2)))    
    sqlAdd = "update  panelinfo  set LEndPCode=" & Val(txtUserName(2).Text) & ",cEndCode=" & Val(txtUserName(9).Text) & ",nowEcount=" & nowEv & " ,writedate=#" & dtpwdate(1) & "#  where  holderID= '" & Trim(txtUserName(0)) & "'"
    cmdExe.CommandText = sqlAdd
    cmdExe.Execute sqlAdd
   ' cnn.Execute sqlAdd
    txtUserName(2).Text = txtUserName(9)
    txtUserName(9) = ""
       cnn.Close   
    MsgBox " 数据保存完成! ", vbInformation
   Unload Me
    End Sub
Private Sub Form_Load()
Dim rst As New ADODB.Recordset
Dim sqlEdit As String
dtpwdate(1).Value = Format(Now, "yyyy-mm-dd")
sqlEdit = "select * from panelinfo  "
sqlEdit = sqlEdit & " where holderid='" & Trim(MDIme.txtUserName(0)) & "'and delflag<>true"
rst.Open sqlEdit, gCnn, adOpenStatic, adLockBatchOptimistic
 If Not rst.EOF Then
    txtUserName(0) = rst.Fields(1)
    txtUserName(1) = rst.Fields(2)
    txtUserName(2) = rst.Fields!cendcode
    dtpwdate(0).Value = rst.Fields(4)
        End If
buttontime = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
 MDIme.loadData (txtUserName(0))
Cancel = 0
End Sub

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

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

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