⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mdifrmmain.frm

📁 vb做的银行管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.MDIForm MDIFrmMain 
   BackColor       =   &H8000000C&
   Caption         =   "银行管理系统"
   ClientHeight    =   7215
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   9015
   LinkTopic       =   "MDIForm1"
   MousePointer    =   2  'Cross
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox Picture1 
      Align           =   1  'Align Top
      Height          =   7215
      Left            =   0
      Picture         =   "MDIFrmMain.frx":0000
      ScaleHeight     =   7155
      ScaleWidth      =   8955
      TabIndex        =   0
      Top             =   0
      Width           =   9015
      Begin MSComDlg.CommonDialog dlg 
         Left            =   0
         Top             =   0
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuFileLogout 
         Caption         =   "注销"
      End
      Begin VB.Menu mnurestore 
         Caption         =   "还原数据库"
      End
      Begin VB.Menu mnubackup 
         Caption         =   "备份数据库"
      End
      Begin VB.Menu mnuFileOut 
         Caption         =   "退出"
      End
   End
   Begin VB.Menu mnuWork 
      Caption         =   "操作(&W)"
      Begin VB.Menu newaccount 
         Caption         =   "开户"
      End
      Begin VB.Menu deleteaccount 
         Caption         =   "销户"
      End
      Begin VB.Menu line 
         Caption         =   "-"
      End
      Begin VB.Menu deposit 
         Caption         =   "存款"
      End
      Begin VB.Menu fetch 
         Caption         =   "取款"
      End
      Begin VB.Menu transfer 
         Caption         =   "转帐"
      End
   End
   Begin VB.Menu mnuAccount 
      Caption         =   "用户(&A)"
      Begin VB.Menu mnuAccountNew 
         Caption         =   "新建"
      End
      Begin VB.Menu mnuAccountDelete 
         Caption         =   "删除"
      End
      Begin VB.Menu mnuAccountUpdata 
         Caption         =   "修改"
      End
   End
   Begin VB.Menu query 
      Caption         =   "查询(&E)"
      Begin VB.Menu queryaccount 
         Caption         =   "银行用户"
      End
      Begin VB.Menu queryclerk 
         Caption         =   "职员信息"
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "帮助(&H)"
      Begin VB.Menu mnuHelpDocument 
         Caption         =   "文档"
      End
      Begin VB.Menu mnuHelpLine1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuHelpAbout 
         Caption         =   "关于"
      End
   End
End
Attribute VB_Name = "MDIFrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 
Private Sub deleteaccount_Click()
deleteaccoun.Show
End Sub

Private Sub deposit_Click()
deposit1.Show
End Sub

Private Sub fetch_Click()
If MsgBox("您好!请根据提示取款!", vbOKCancel, "提示") = vbOK Then
fetch1.Show
End If
End Sub

Private Sub mnuAccountDelete_Click()

deleteSysacc.Show
End Sub

Private Sub mnuAccountNew_Click()

newSysacc.Show
End Sub

Private Sub mnuAccountUpdata_Click()
If power = "common" Then
modification.Label7.Visible = False
modification.Combo1.Visible = False
End If
modification.Show
End Sub

Private Sub mnubackup_Click()
  If MsgBox("真的要执行备份吗?", vbOKCancel + vbInformation, "提示") = vbOK Then     '如果确定提示
        '''''''''''''''''''''''''''''''''''''''' 初始化保存文件对话框↓
        dlg.CancelError = False
        dlg.Filter = "(*.bak)|*.bak"
        dlg.ShowSave
        '''''''''''''''''''''''''''''''''''''''''''''
        If dlg.FileName = "" Then   '如果文件为空,则退出
            Exit Sub
        End If
        '''''''''''''''''''''''''''''''''''''''''''''''''
        If Dir(dlg.FileName) <> "" Then     '如果文件已经存在
            If MsgBox("文件" & dlg.FileName & "已存在!要替换吗?", vbOKCancel + vbInformation, "提示") = vbOK Then
                Kill dlg.FileName           '删除此文件
            Else
                Exit Sub
            End If
        End If
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        'Call LinkDB(landWay, SName, "master", SUName, SUPw)     '此语句用于连接数据库,具体可以到 shareFunction 模块中找到说明
        cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=(local)"
        cn.Open
        MousePointer = 11
        cn.Execute "backup database bank to disk='" & dlg.FileName & "'"  '备份数据库到指定文件
        cn.Close
        MousePointer = 0
        MsgBox "备份成功"
    End If
End Sub

Private Sub mnuFileLogout_Click()
Unload Me
landForm1.Show
End Sub

Private Sub mnuFileOut_Click()
Unload Me
End Sub

Private Sub mnuHelpDocument_Click()
MsgBox ("对不起!本系统还未建立帮助文件!")
End Sub

Private Sub mnurestore_Click()
Dim rst As Recordset
Set cn = New Connection
Set rst = New Recordset
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    If MsgBox("真的要恢复数据库吗?数据恢复操作将会覆盖以前的所有数据并且覆盖后无法恢复,您确定要进行恢复操作吗?", vbOKCancel + vbInformation, "提示") = vbOK Then     '如果确定提示
        ''''''''''''''''''''''''''''''''''''''''''' 初始化打开文件对话框↓
        dlg.CancelError = False
        dlg.Filter = "(*.bak)|*.bak"
        dlg.ShowOpen
        ''''''''''''''''''''''''''''''''''''''''''' 如果选择的文件为空,则退出
        If dlg.FileName = "" Then
            Exit Sub
        End If
        ''''''''''''''''''''''''''''''''''''''''''' 如果选择的文件不存在,则退出
        If Dir(dlg.FileName) = "" Then
            MsgBox "文件" & dlg.FileName & "不存在!", vbOKOnly + vbInformation, "提示"
            Exit Sub
        End If
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        '还原数据库↓
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        On Error GoTo errDB
        Dim errDBV As Boolean
        errDBV = True
        cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=(local)"
        cn.Open
        rst.Open "select spid from sysprocesses where dbid=db_id('bank')", cn
       Do While Not rst.EOF
       cn.Execute "kill " & rst("spid")
       rst.MoveNext
       Loop
       rst.Close
       'cn.Close
       
        'cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=(local)"

        'cn.Open
        MousePointer = 11
        cn.Execute "RESTORE DATABASE bank FROM disk='" & dlg.FileName & "' WITH replace"
      ' cn.Execute "RESTORE DATABASE bank FROM disk='d:\aa.bak' with replace"
        cn.Close
        errDBV = False
        MousePointer = 0
        MsgBox "数据库还原成功"
    End If
errDB:
    If errDBV Then  '如果还原失败,则给出提示
        MsgBox "数据库还原失败,可能是因为此数据库正在使用,请试着在还原前重启 SQL 数据库!"
        MousePointer = 0
        Exit Sub
    End If
End Sub

Private Sub newaccount_Click()
newaccount1.Text1(4).Text = sid        '将操作员的卡号传给开户下一步
newaccount1.Text1(4).Enabled = False
If MsgBox("您好!欢迎您成为本银行的用户,请根据提示开户!", vbOKCancel, "提示") = vbOK Then
newaccount1.Show
End If
End Sub

Private Sub queryaccount_Click()
queryaccount1.Show
End Sub

Private Sub queryclerk_Click()
queryclerk1.Show
End Sub

Private Sub transfer_Click()
'If MsgBox("您好!请根据提示转帐!", vbOKCancel, "提示") = vbOK Then
transfer1.Show
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -