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

📄 form6.frm

📁 带界面的银行管理系统。包括客户界面和内部管理界面。采用两种方式来实现数据库的连接和实现。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form6 
   BackColor       =   &H00FFFFFF&
   Caption         =   "录入"
   ClientHeight    =   5865
   ClientLeft      =   60
   ClientTop       =   435
   ClientWidth     =   7950
   BeginProperty Font 
      Name            =   "楷体_GB2312"
      Size            =   15
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form6"
   Picture         =   "Form6.frx":0000
   ScaleHeight     =   5865
   ScaleWidth      =   7950
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "员工基本资料"
      Height          =   4695
      Left            =   360
      TabIndex        =   2
      Top             =   120
      Width           =   7095
      Begin VB.TextBox Text2 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         Height          =   495
         Left            =   2520
         TabIndex        =   14
         Top             =   1080
         Width           =   3855
      End
      Begin VB.TextBox Text1 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         Height          =   495
         Left            =   2520
         TabIndex        =   7
         Top             =   360
         Width           =   3855
      End
      Begin VB.TextBox Text3 
         Alignment       =   2  'Center
         Height          =   495
         Left            =   2520
         TabIndex        =   6
         Top             =   1920
         Width           =   3855
      End
      Begin VB.TextBox Text4 
         Alignment       =   2  'Center
         Height          =   495
         Left            =   2520
         TabIndex        =   5
         Top             =   2640
         Width           =   3855
      End
      Begin VB.TextBox Text5 
         Alignment       =   2  'Center
         Height          =   495
         IMEMode         =   3  'DISABLE
         Left            =   2520
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   3360
         Width           =   3855
      End
      Begin VB.TextBox Text6 
         Alignment       =   2  'Center
         Height          =   495
         Left            =   2520
         TabIndex        =   3
         Top             =   4080
         Width           =   3855
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "操作帐号"
         Height          =   495
         Left            =   240
         TabIndex        =   13
         Top             =   1080
         Width           =   1575
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "姓名"
         Height          =   495
         Left            =   120
         TabIndex        =   12
         Top             =   480
         Width           =   1575
      End
      Begin VB.Label Label3 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "家庭住址"
         Height          =   495
         Left            =   120
         TabIndex        =   11
         Top             =   1920
         Width           =   1575
      End
      Begin VB.Label Label4 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "联系电话"
         Height          =   495
         Left            =   240
         TabIndex        =   10
         Top             =   2640
         Width           =   1575
      End
      Begin VB.Label Label5 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "操作密码"
         Height          =   495
         Left            =   120
         TabIndex        =   9
         Top             =   3360
         Width           =   1575
      End
      Begin VB.Label Label6 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         Caption         =   "上级帐号"
         Height          =   495
         Left            =   120
         TabIndex        =   8
         Top             =   4080
         Width           =   1575
      End
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00C0E0FF&
      Caption         =   "退出"
      Height          =   615
      Left            =   4440
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   5040
      Width           =   2055
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00C0E0FF&
      Caption         =   "确定"
      Height          =   615
      Left            =   840
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   5040
      Width           =   2055
   End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rst As New ADODB.Recordset
Dim rstl As New ADODB.Recordset
Private Sub Command1_Click()
con.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wuhao"
If Text1.Text = "" Then
        MsgBox "姓名不能为空!"
        Text1.SetFocus
ElseIf Text2.Text = "" Then
       MsgBox "操作帐号不能为空!"
        Text2.SetFocus
ElseIf Text5.Text = "" Then
        MsgBox "密码不能为空!"
        Text5.SetFocus
ElseIf Text6.Text = "" Then
        MsgBox "上级帐号不能为空!"
        Text6.SetFocus
ElseIf Len(Text1.Text) > 15 Then
        MsgBox "姓名不能长于15位英文或7位中文"
        Text1.SetFocus
ElseIf Len(Text2.Text) > 15 Then
        MsgBox "操作帐号不得长于15位"
        Text2.SetFocus
ElseIf Len(Text4.Text) > 20 Then
        MsgBox "电话号码不得长于20位"
        Text4.SetFocus
ElseIf Len(Text3.Text) > 50 Then
        MsgBox "住址不得50个英文或25个中文"
        Text3.SetFocus
ElseIf Len(Text5.Text) > 15 Then
        MsgBox "密码不得大于15位"
        Text5.SetFocus

Else
 rst.Open "select worker_id from worker_xx053_19  ", con, adOpenKeyset, adLockOptimistic
 If (rst.EOF) Then
     Text2.Text = "0903050301"
     Else
    hello = rst.Sort
     rst.MoveLast
    Text2.Text = Right("0903050300" & CStr(CLng(rst.Fields(0)) + 1), 10)
     End If
     rst.Close
     rstl.Open "select * from worker_xx053_19  ", con, adOpenKeyset, adLockOptimistic
     rstl.AddNew
     rstl.Fields(0) = Trim(Text2.Text)
     rstl.Fields(1) = Trim(Text1.Text)
     rstl.Fields(2) = Trim(Text3.Text)
     rstl.Fields(3) = Trim(Text4.Text)
     rstl.Fields(4) = Trim(Text5.Text)
     rstl.Fields(5) = Trim(Text6.Text)
     rstl.Update
     MsgBox "成功添加数据"
     rstl.Close
     con.Close
        Text1.Text = ""
        Text2.Text = ""
        Text3.Text = ""
        Text4.Text = ""
        Text5.Text = ""
        Text6.Text = ""
        Text1.SetFocus
     End If
    
End Sub

Private Sub Command2_Click()
Unload Me
Form5.Show
End Sub

Private Sub Form_Load()

End Sub

⌨️ 快捷键说明

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