📄 form3.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form3
Caption = "注册新用户"
ClientHeight = 4590
ClientLeft = 60
ClientTop = 450
ClientWidth = 7170
LinkTopic = "Form3"
ScaleHeight = 4590
ScaleWidth = 7170
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 615
Left = 1200
Top = 3600
Visible = 0 'False
Width = 3975
_ExtentX = 7011
_ExtentY = 1085
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=guan;Initial Catalog=guan"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=guan;Initial Catalog=guan"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 系统信息"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3840
TabIndex = 8
Top = 2880
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确认"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 7
Top = 2880
Width = 1335
End
Begin VB.TextBox Text3
Height = 495
IMEMode = 3 'DISABLE
Left = 3720
PasswordChar = "*"
TabIndex = 3
Top = 2040
Width = 1815
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 3720
PasswordChar = "*"
TabIndex = 2
Top = 1440
Width = 1815
End
Begin VB.TextBox Text1
Height = 495
Left = 3720
TabIndex = 1
Top = 840
Width = 1815
End
Begin VB.Label Label4
Caption = "确认密码"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 6
Top = 2040
Width = 1815
End
Begin VB.Label Label3
Caption = "输入密码"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 5
Top = 1440
Width = 1815
End
Begin VB.Label Label2
Caption = " 用户名:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 4
Top = 840
Width = 1815
End
Begin VB.Label Label1
Caption = "注册新用户"
BeginProperty Font
Name = "华文彩云"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 0
Top = 240
Width = 2175
End
End
Attribute VB_Name = "form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sqlstr As String
sqlstr = "select * from 系统信息 where 用户名='" & Text1.Text & "'"
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
If Text1.Text = "" Then '判断用户名是否为空
MsgBox "请输入用户名!", vbExclamation, "警告"
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
ElseIf Adodc1.Recordset.EOF = False Then '判断输入的用户名是否已存在
MsgBox "此用户名已存在,请重新输入!", vbExclamation, "警告"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
ElseIf Text2.Text = "" Then '判断密码是否为空
MsgBox "请输入密码!", vbExclamation, "警告"
Text3.Text = ""
Text2.SetFocus
ElseIf Text3.Text = "" Then '判断确认密码是否为空
MsgBox "请输入确认密码!", vbExclamation, "警告"
Text3.SetFocus
ElseIf Text2.Text <> Text3.Text Then '判断二次密码输入是否一致
MsgBox "两次输入的密码不一致,请重新输入!", vbExclamation, "警告"
Text2.Text = "": Text3.Text = ""
Text2.SetFocus
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("用户名") = Text1.Text
Adodc1.Recordset.Fields("密码") = Text2.Text
Adodc1.Recordset.Update
MsgBox "注册新用户成功,请登录!", vbInformation, "注册成功"
Form2.Show
Unload MDIForm1
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -