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

📄 frmadd.frm

📁 水质模糊综合评价系统 水质模糊综合评价系统 水质模糊综合评价系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmManagement 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "用户管理"
   ClientHeight    =   5190
   ClientLeft      =   3210
   ClientTop       =   2475
   ClientWidth     =   7680
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5190
   ScaleWidth      =   7680
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame1 
      Height          =   3015
      Left            =   1200
      TabIndex        =   1
      Top             =   1200
      Width           =   5415
      Begin VB.PictureBox Pic1 
         Height          =   255
         Left            =   5040
         ScaleHeight     =   195
         ScaleWidth      =   195
         TabIndex        =   18
         Top             =   1440
         Width           =   255
      End
      Begin VB.TextBox Text4 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   2280
         MaxLength       =   50
         PasswordChar    =   "*"
         TabIndex        =   17
         Top             =   1680
         Width           =   2295
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   2280
         MaxLength       =   50
         TabIndex        =   6
         Top             =   360
         Width           =   2295
      End
      Begin VB.TextBox Text3 
         Height          =   375
         IMEMode         =   3  'DISABLE
         Left            =   2280
         MaxLength       =   50
         PasswordChar    =   "*"
         TabIndex        =   5
         Top             =   1080
         Width           =   2295
      End
      Begin VB.CommandButton Command1 
         Height          =   495
         Left            =   360
         Picture         =   "FrmAdd.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   2280
         Width           =   1215
      End
      Begin VB.CommandButton Command2 
         Height          =   495
         Left            =   3720
         Picture         =   "FrmAdd.frx":0F69
         Style           =   1  'Graphical
         TabIndex        =   3
         Top             =   2280
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         Height          =   495
         Left            =   2040
         Picture         =   "FrmAdd.frx":1EE4
         Style           =   1  'Graphical
         TabIndex        =   2
         Top             =   2280
         Width           =   1215
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "确认密码:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   495
         Left            =   360
         TabIndex        =   16
         Top             =   1680
         Width           =   1695
      End
      Begin VB.Label mm 
         BackStyle       =   0  'Transparent
         Caption         =   "密    码:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   360
         TabIndex        =   8
         Top             =   960
         Width           =   1815
      End
      Begin VB.Label yhm 
         BackStyle       =   0  'Transparent
         Caption         =   "用 户 名:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   360
         TabIndex        =   7
         Top             =   360
         Width           =   1695
      End
   End
   Begin VB.Frame Frame2 
      Height          =   2895
      Left            =   1200
      TabIndex        =   9
      Top             =   1080
      Width           =   5295
      Begin VB.CommandButton Command6 
         Height          =   495
         Left            =   3600
         Picture         =   "FrmAdd.frx":2FB9
         Style           =   1  'Graphical
         TabIndex        =   15
         Top             =   2280
         Width           =   1095
      End
      Begin VB.CommandButton Command5 
         Height          =   495
         Left            =   2100
         Picture         =   "FrmAdd.frx":4076
         Style           =   1  'Graphical
         TabIndex        =   14
         Top             =   2280
         Width           =   1095
      End
      Begin VB.CommandButton Command4 
         Height          =   495
         Left            =   600
         Picture         =   "FrmAdd.frx":5167
         Style           =   1  'Graphical
         TabIndex        =   13
         Top             =   2280
         Width           =   1095
      End
      Begin VB.TextBox Text2 
         Height          =   390
         IMEMode         =   3  'DISABLE
         Left            =   3240
         MaxLength       =   50
         TabIndex        =   12
         Top             =   1800
         Width           =   1215
      End
      Begin MSDataGridLib.DataGrid DataGrid1 
         Height          =   1575
         Left            =   120
         TabIndex        =   10
         Top             =   240
         Width           =   5055
         _ExtentX        =   8916
         _ExtentY        =   2778
         _Version        =   393216
         BackColor       =   16777215
         Enabled         =   -1  'True
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "请输入查询的用户名:"
         ForeColor       =   &H00FF0000&
         Height          =   270
         Left            =   720
         TabIndex        =   11
         Top             =   1920
         Width           =   2055
      End
   End
   Begin MSComctlLib.TabStrip TabStrip1 
      Height          =   3615
      Left            =   960
      TabIndex        =   0
      Top             =   720
      Width           =   5895
      _ExtentX        =   10398
      _ExtentY        =   6376
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   2
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "添加/删除用户"
            Key             =   "yhgl"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "浏览用户"
            Key             =   "llyh"
            ImageVarType    =   2
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "FrmManagement"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim WithEvents rs As Recordset
Attribute rs.VB_VarHelpID = -1

Dim i As Integer
Dim j As Integer
Private Sub BackG(f As Form, pic As PictureBox)
For i = 0 To (f.ScaleWidth \ pic.Width)
   For j = 0 To (f.ScaleHeight \ pic.Height)
      PaintPicture pic.Picture, i * pic.Width, j * pic.Height
       Next
    Next
End Sub
Private Sub Form_Load()
Frame1.Visible = True
Frame2.Visible = False


Me.AutoRedraw = True
Pic1.Visible = False
Pic1.BorderStyle = 0
Pic1.AutoSize = True
Pic1.Picture = LoadPicture(App.Path + "\1.jpg")
BackG Me, Pic1

End Sub
Private Sub Form_resize()
BackG Me, Pic1
End Sub


Private Sub Command1_Click()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db1.mdb;" & "Persist Security Info=False;"
Set rs = New Recordset
rs.Open "select*from 用户", db, adOpenStatic, adLockOptimistic
If Text1 = "" Then
MsgBox "用户名不能为空", vbExclamation, "警告"
Text1.SetFocus
Exit Sub
End If
rs.MoveFirst
Do While rs.EOF = False
If rs("user_name") = Text1 Then
MsgBox "用户名已存在,请重新输入", vbExclamation, "警告"
Text1 = ""
Text3 = ""
Text4 = ""
Text1.SetFocus
Exit Sub
End If
rs.MoveNext
Loop
If Trim(Text3.Text) <> Trim(Text4.Text) Then
MsgBox "两次输入密码不一样,请确认", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1 = ""
Text3 = ""
Text4 = ""
Exit Sub
End If
rs.AddNew
rs("user_name") = Text1
rs("user_psw") = Text3
rs.Update
MsgBox "添加用户成功,请记住你的口令和密码", vbInformation, "提示"
Text1 = ""
Text3 = ""
Text4 = ""
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db1.mdb;" & "Persist Security Info=False;"
Set rs = New Recordset
rs.Open "select *from 用户 where user_name='" & Text1.Text & "'", db, adOpenStatic, adLockOptimistic

If (rs.EOF And rs.BOF) Then
        MsgBox "用户不存在", vbCritical, "删除用户"
        Exit Sub
    

ElseIf Not (rs.BOF And rs.EOF) Then
Dim response, Msg, Style, Title, Help, Ctxt
Msg = "你确实要删除此用户吗?你将彻底删除此用户!"   ' 定义信息。
Style = vbOKCancel   ' 定义按钮。
Title = "删除用户"   ' 定义标题。
Ctxt = 1000   ' 定义标题
      ' 上下文。
      ' 显示信息
response = MsgBox(Msg, Style, Title, Help, Ctxt)
If response = vbCancel Then
Exit Sub
ElseIf response = vbOK Then
     rs.Delete
     rs.Update
     MsgBox "用户删除成功!", vbInformation, "完成"
    rs.Close
     End If
     End If
   Text1.Text = ""
   Text3 = ""
   Text4 = ""
End Sub

Private Sub Command4_Click()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db1.mdb;" & "Persist Security Info=False;"
Set rs = New Recordset
 rs.Open "select * from 用户 where user_name='" & Text2 & "'", db, adOpenStatic, adLockOptimistic
 If rs.EOF = True Then
 MsgBox "用户名不存在", vbInformation + vbOKCancel, "警告"
 Else
  Set DataGrid1.DataSource = rs
  End If
Text2.Text = ""
 
  End Sub

Private Sub Command5_Click()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db1.mdb;" & "Persist Security Info=False;"
Set rs = New Recordset
rs.Open "select * from 用户", db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rs


End Sub

Private Sub Command6_Click()
Unload Me
End Sub



Private Sub TabStrip1_Click()
Select Case TabStrip1.SelectedItem.Key
Case "yhgl"
Frame1.Visible = True
Frame2.Visible = False
Case "llyh"
Frame1.Visible = False
Frame2.Visible = True
End Select
End Sub

⌨️ 快捷键说明

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