Private Sub qianfeilm_Click()
frmList.qfFlg = True
frmList.Show
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Trim(Button.Key)
Case "a"
frmFee.Show 1
Case "b"
frmCopyP.Show
Case "c"
frmFee.Show 1
Case "d"
frmbeifen.Show 1
Case "e"
frmdaoru.Show 1
Case "f"
frmFeefind.Show 1
Case "g"
frmFind1.Show 1
Case "dhcb1"
Case "dbcb2"
Case "j"
X = MsgBox("真的要退出吗?", vbYesNo + vbQuestion, "警告")
If X = vbYes Then
End
Else
End If
End Select
End Sub
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
Select Case ButtonMenu.Key
Case "dhcb1"
frmCopyP.Show
Case "dhcb2"
usrcopyP.Show
End Select
End Sub
Private Sub weihu_Click()
FRMYHSD.Show
End Sub
Private Sub yihu_Click()
frmCuifei.muser1 = 1
frmCuifei.Show
End Sub
备份界面设计:
:
备份代码设计:
Private Sub Command1_Click()
Dim a As String
a = App.Path
a = a & "\"
b = Text1.Text
'On Error GoTo errhandle:
Dim filename As String
filename = "" & Text1.Text & "dbdb.mdb"
If a = Text1.Text Then
MsgBox "备份目录与原文件目录相同,请重新选择!"
Exit Sub
End If
If Dir("" & b & "dbdb.mdb") <> "" Then
Dim llp As String
llp = MsgBox("此目录下已有该文件,要覆盖吗?", vbYesNo, "备份文件")
If llp = vbYes Then
Kill ("" & b & "dbdb.mdb")
FileCopy "" & a & "\data\dbdb.mdb", "" & b & "dbdb.mdb"
Dim l
l = MsgBox(" 备份成功! ", vbOKOnly, "提示")
Else
Exit Sub
End If
Else
FileCopy "" & a & "\data\dbdb.mdb", "" & b & "dbdb.mdb"
Dim ll
ll = MsgBox(" 备份成功! ", vbOKOnly, "提示")
End If
Exit Sub
'errhandle:
'MsgBox "出现错误,不能复制", vbOKOnly + vbCritical, "复制文件"
'Resume Next
End Sub
Private Sub Command2_Click()
'dy
'Me.Hide
Unload Me
End Sub
Private Sub Dir1_Change()
'Drive1.Drive = Dir1
If Right(Dir1.Path, 1) <> "\" Then
Text1.Text = Dir1.Path + "\"
Else
Text1.Text = Dir1.Path
End If
Command1.Enabled = True
End Sub
Private Sub Dir1_Click()
If Right(Dir1.Path, 1) <> "\" Then
Text1.Text = Dir1.Path + "\"
Else
Text1.Text = Dir1.Path
End If
Command1.Enabled = True
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Activate()
Command1.Enabled = False
gCnn.Close
ChDrive App.Path
ChDir App.Path
'Text1.SetFocus
'Text1.Text = "c:\"
Text1.Text = CurDir()
Text1.Enabled = False
End Sub
Private Sub Form_Load()
ChDrive App.Path
ChDir App.Path
End Sub
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 Sub
单户抄表界面设计:
单户抄表代码设计:
Private Sub Command2_Click()
Dim cnn As New ADODB.Connection
Di