📄 tjyh.frm
字号:
VERSION 5.00
Begin VB.Form tjyh
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "添加用户"
ClientHeight = 2445
ClientLeft = 3585
ClientTop = 3150
ClientWidth = 3960
Icon = "tjyh.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2445
ScaleWidth = 3960
ShowInTaskbar = 0 'False
Begin VB.TextBox Text3
BackColor = &H00C0FFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 7
Top = 1200
Width = 2535
End
Begin VB.TextBox Text2
BackColor = &H00C0FFFF&
Height = 270
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 5
Top = 720
Width = 2535
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 270
Left = 1200
TabIndex = 3
Top = 240
Width = 2535
End
Begin VB.CommandButton CancelButton
Caption = "取消"
Height = 375
Left = 2280
TabIndex = 1
Top = 1800
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "确定"
Default = -1 'True
Height = 375
Left = 600
TabIndex = 0
Top = 1800
Width = 1215
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "验证密码:"
Height = 180
Left = 120
TabIndex = 6
Top = 1320
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "密码:"
Height = 180
Left = 120
TabIndex = 4
Top = 840
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "用户名:"
Height = 180
Left = 120
TabIndex = 2
Top = 360
Width = 720
End
End
Attribute VB_Name = "tjyh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public addnewstate As Boolean
Public upok As Boolean
Private Sub CancelButton_Click()
Me.Hide
upok = False
End Sub
Private Sub Form_Paint()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub OKButton_Click()
On Error GoTo errh
Dim rs As New Recordset
'If addnewstate Then
If Text1.Text <> "" Then
If Text2.Text <> "" Then
If Text3.Text = Text2.Text Then
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
rs.Open "用户表", cn, , , adCmdTable
rs.AddNew
rs.Fields("Password").Value = Text2.Text
rs.Fields("UserName").Value = Text1.Text
rs.Update
rs.Close
Me.Hide
upok = True
MsgBox "添加成功"
Else
MsgBox "密码错误,请重新输入!"
End If
Else
MsgBox "密码不能为空,请输入密码!"
End If
Else
MsgBox "用户名不能为空"
End If
' End If
Exit Sub
errh:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -