form1.frm
来自「源码+论文 vB+access的毕业设计,请大家参考」· FRM 代码 · 共 172 行
FRM
172 行
VERSION 5.00
Begin VB.Form frmuse
Caption = "修改用户"
ClientHeight = 2160
ClientLeft = 3435
ClientTop = 2460
ClientWidth = 4785
LinkTopic = "Form1"
ScaleHeight = 2160
ScaleWidth = 4785
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 270
Index = 3
Left = 1560
TabIndex = 10
Top = 1560
Width = 1335
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 270
Index = 2
Left = 1560
TabIndex = 9
Top = 1200
Width = 1335
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 270
Index = 1
Left = 1560
TabIndex = 8
Top = 720
Width = 1335
End
Begin VB.Frame Frame1
Caption = "修改密码:"
ForeColor = &H000000FF&
Height = 1935
Left = 0
TabIndex = 0
Top = 120
Width = 4695
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3480
TabIndex = 7
Top = 1200
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 3480
TabIndex = 6
Top = 480
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 270
Index = 0
Left = 1560
TabIndex = 5
Top = 240
Width = 1335
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "新的密码:"
ForeColor = &H00FF0000&
Height = 180
Left = 480
TabIndex = 4
Top = 1080
Width = 810
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "确认密码:"
ForeColor = &H00FF0000&
Height = 180
Left = 480
TabIndex = 3
Top = 1560
Width = 810
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密码:"
ForeColor = &H00FF0000&
Height = 180
Left = 720
TabIndex = 2
Top = 720
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入用户名:"
ForeColor = &H00FF0000&
Height = 180
Left = 120
TabIndex = 1
Top = 240
Width = 1170
End
End
End
Attribute VB_Name = "frmuse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
If Text1(0).Text = "" Then
MsgBox "用户名不能为空!", vbExclamation + vbOKOnly, "警告"
Text1(0).SetFocus
Exit Sub
End If
If Text1(1).Text = "" Then
MsgBox "密码不能为空!", vbExclamation + vbOKOnly, "警告"
Text1(1).SetFocus
Exit Sub
End If
If Text1(2).Text = "" Then
MsgBox " 新的确密码不能为空!", vbExclamation + vbOKOnly, "警告"
Text1(2).SetFocus
Exit Sub
End If
If Text1(3).Text = "" Then
MsgBox "确认密码不能为空!", vbExclamation + vbOKOnly, "警告"
Text1(3).SetFocus
Exit Sub
End If
txtSQL = "select * from use where username='" & Trim(Text1(0)) & "'and password='" & Trim(Text1(1)) & "'"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = False Then
txtSQL = "delete from use where username='" & Trim(Text1(0)) & "'"
Else
MsgBox "用户密码输入错误!", vbOKOnly, "警告"
Text1(1).SetFocus
Exit Sub
End If
Set mrc = ExecuteSQL(txtSQL)
txtSQL = "select * from use"
Set mrc = ExecuteSQL(txtSQL)
mrc.AddNew
mrc.Fields(0) = Trim(Text1(0))
mrc.Fields(1) = Trim(Text1(2))
mrc.Fields(2) = Now
mrc.Update
mrc.Close
For i = 0 To 3
Text1(i) = ""
Next
MsgBox "用户信息修改成功!", vbOKOnly, "提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?