论文无忧网提供:计算机毕业论文范文|计算机毕业设计|计算机毕业论文
栏目导航 ASP Java Web .NET VB6.0 JAVA VC VF DELPHI PB 计算机网络 计算机科学与技术 PHP 安卓APP 其他 C# 代写论文
当前位置: > 计算机 > VB6.0 >

A450电表管理系统

   4.      备份界面设计:

copyright paper51.com

:

http://www.paper51.com

备份代码设计:

copyright paper51.com

Private SubCommand1_Click() 内容来自www.paper51.com

Dim a As String

copyright paper51.com

a = App.Path 内容来自论文无忧网 www.paper51.com

a = a &"\"

copyright paper51.com

b = Text1.Text

copyright paper51.com

'On Error GoToerrhandle: copyright paper51.com

Dim filename AsString

http://www.paper51.com

filename ="" & Text1.Text & "dbdb.mdb"

http://www.paper51.com

If a = Text1.TextThen

paper51.com

MsgBox "备份目录与原文件目录相同,请重新选择!" 内容来自论文无忧网 www.paper51.com

Exit Sub copyright paper51.com

End If

copyright paper51.com

IfDir("" & b & "dbdb.mdb") <> "" Then http://www.paper51.com

Dim llp As String 内容来自论文无忧网 www.paper51.com

llp =MsgBox("此目录下已有该文件,要覆盖吗?", vbYesNo, "备份文件") paper51.com

If llp = vbYesThen

copyright paper51.com

Kill (""& b & "dbdb.mdb") 内容来自www.paper51.com

FileCopy"" & a & "\data\dbdb.mdb", "" & b& "dbdb.mdb" paper51.com

Dim l

内容来自论文无忧网 www.paper51.com

l =MsgBox("    备份成功!   ", vbOKOnly, "提示")

http://www.paper51.com

Else 内容来自www.paper51.com

Exit Sub 内容来自论文无忧网 www.paper51.com

End If http://www.paper51.com

Else

内容来自论文无忧网 www.paper51.com

FileCopy"" & a & "\data\dbdb.mdb", "" & b& "dbdb.mdb"

http://www.paper51.com

Dim ll 内容来自www.paper51.com

ll =MsgBox("   备份成功!   ", vbOKOnly, "提示") 内容来自www.paper51.com

End If http://www.paper51.com

Exit Sub

http://www.paper51.com

'errhandle: copyright paper51.com

'MsgBox "出现错误,不能复制", vbOKOnly + vbCritical, "复制文件"

http://www.paper51.com

'Resume Next

paper51.com

End Sub

copyright paper51.com

Private Sub Command2_Click()

内容来自www.paper51.com

'dy

http://www.paper51.com

'Me.Hide

内容来自论文无忧网 www.paper51.com

Unload Me 内容来自论文无忧网 www.paper51.com

End Sub http://www.paper51.com

Private SubDir1_Change() http://www.paper51.com

'Drive1.Drive =Dir1

paper51.com

IfRight(Dir1.Path, 1) <> "\" Then

内容来自论文无忧网 www.paper51.com

Text1.Text =Dir1.Path + "\"

paper51.com

Else copyright paper51.com

Text1.Text =Dir1.Path

内容来自www.paper51.com

End If

copyright paper51.com

Command1.Enabled =True paper51.com

End Sub copyright paper51.com

Private SubDir1_Click()

内容来自论文无忧网 www.paper51.com

If Right(Dir1.Path,1) <> "\" Then http://www.paper51.com

Text1.Text =Dir1.Path + "\"

copyright paper51.com

Else http://www.paper51.com

Text1.Text =Dir1.Path paper51.com

End If

copyright paper51.com

Command1.Enabled =True http://www.paper51.com

End Sub 内容来自www.paper51.com

Private SubDrive1_Change() copyright paper51.com

Dir1.Path =Drive1.Drive paper51.com

End Sub

copyright paper51.com

Private SubForm_Activate() paper51.com

Command1.Enabled =False

http://www.paper51.com

gCnn.Close

http://www.paper51.com

ChDrive App.Path

内容来自www.paper51.com

ChDir App.Path

copyright paper51.com

'Text1.SetFocus 内容来自www.paper51.com

'Text1.Text ="c:\"

内容来自www.paper51.com

Text1.Text =CurDir()

copyright paper51.com

Text1.Enabled =False

内容来自www.paper51.com

End Sub

内容来自论文无忧网 www.paper51.com

Private SubForm_Load()

paper51.com

ChDrive App.Path paper51.com

ChDir App.Path

copyright paper51.com

End Sub paper51.com

Private SubForm_QueryUnload(Cancel As Integer, UnloadMode As Integer) copyright paper51.com

dy copyright paper51.com

End Sub

paper51.com

Private SubForm_Unload(Cancel As Integer) 内容来自www.paper51.com

If gCnn.State = 0Then

copyright paper51.com

 gCnn.ConnectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= "& DbPassword & " ;Data Source= " & _ 内容来自www.paper51.com

    App.Path &"\data\dbdb.mdb;Persist Security Info=False" 内容来自www.paper51.com

    gCnn.CursorLocation =adUseClient http://www.paper51.com

    gCnn.Open

http://www.paper51.com

End If paper51.com

MDIme.loadAdd

内容来自www.paper51.com

End Sub

copyright paper51.com

5.      单户抄表界面设计:

copyright paper51.com

内容来自论文无忧网 www.paper51.com

单户抄表代码设计: 内容来自www.paper51.com

Private SubCommand2_Click() paper51.com

    Dim cnn As NewADODB.Connection copyright paper51.com

    Dim rstE As NewADODB.Recordset

http://www.paper51.com

    Dim cmdExe As NewADODB.Command

paper51.com

    Dim nowEv As Double paper51.com

    Dim sqlAdd As String 内容来自论文无忧网 www.paper51.com

    If Trim(txtUserName(0).Text)= "" Then

http://www.paper51.com

       MsgBox" 没有要抄表用户,请先添加用户!  ", vbInformation http://www.paper51.com

       Exit Sub

内容来自论文无忧网 www.paper51.com

    End If

http://www.paper51.com

    If Trim(txtUserName(9).Text)= "" Then

copyright paper51.com

       MsgBox" 请先输入数据!  ", vbInformation paper51.com

       Exit Sub

内容来自论文无忧网 www.paper51.com

    End If

内容来自论文无忧网 www.paper51.com

    http://www.paper51.com

    If Trim(txtUserName(9).Text)< Trim(txtUserName(2).Text) Then 内容来自www.paper51.com

       MsgBox" 输入数据错误,当前止码太小!  ", vbInformation http://www.paper51.com

       Exit Sub

copyright paper51.com

    End If

http://www.paper51.com

    cnn.ConnectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= "& DbPassword & " ;Data Source= " & _

copyright paper51.com

    App.Path &"\data\dbdb.mdb;Persist Security Info=False"

copyright paper51.com

    cnn.CursorLocation =adUseClient 内容来自www.paper51.com

    cnn.Open 内容来自论文无忧网 www.paper51.com

    cmdExe.ActiveConnection =cnn

paper51.com

    rstE.Open "selectnowecount from panelinfo where holderID= '" & Trim(txtUserName(0)) & "'", cnn,adOpenStatic, adLockBatchOptimistic copyright paper51.com

    copyright paper51.com

    nowEv =Val(rstE.Fields(0).Value) + (Val(txtUserName(9)) - Val(txtUserName(2)))

内容来自论文无忧网 www.paper51.com

    paper51.com

    内容来自论文无忧网 www.paper51.com

    sqlAdd = "update  panelinfo  set LEndPCode=" &Val(txtUserName(2).Text) & ",cEndCode=" &Val(txtUserName(9).Text) & ",nowEcount=" & nowEv & ",writedate=#" & dtpwdate(1) & "#  where  holderID= '" & Trim(txtUserName(0))& "'"

copyright paper51.com

    cmdExe.CommandText = sqlAdd copyright paper51.com

    cmdExe.Execute sqlAdd 内容来自www.paper51.com

   ' cnn.Execute sqlAdd 内容来自www.paper51.com

    txtUserName(2).Text =txtUserName(9)

copyright paper51.com

    txtUserName(9) =""

paper51.com

   paper51.com

    cnn.Close

copyright paper51.com

    paper51.com

    MsgBox " 数据保存完成! ", vbInformation

内容来自www.paper51.com

   Unload Me paper51.com

   

copyright paper51.com

End Sub

内容来自论文无忧网 www.paper51.com

------分隔线----------------------------
联系方式