📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form 用户注册
Caption = " 用户注册"
ClientHeight = 7740
ClientLeft = 60
ClientTop = 450
ClientWidth = 7905
LinkTopic = "Form2"
Picture = "Form2.frx":0000
ScaleHeight = 7740
ScaleWidth = 7905
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data4
Caption = "Data4"
Connect = "Access 2000;"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 3720
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 7440
Visible = 0 'False
Width = 1215
End
Begin VB.Data Data3
Caption = "Data3"
Connect = "Access 2000;"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 2520
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 7440
Visible = 0 'False
Width = 1215
End
Begin VB.Data Data2
Caption = "Data2"
Connect = "Access 2000;"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 1320
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 7440
Visible = 0 'False
Width = 1215
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access 2000;"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 7440
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "返回上一目录"
Height = 495
Left = 4080
TabIndex = 32
Top = 7080
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 495
Left = 2280
TabIndex = 31
Top = 7080
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "检验是否可用"
Height = 495
Left = 5040
TabIndex = 29
Top = 120
Width = 1455
End
Begin VB.TextBox Text6
Height = 495
Left = 2400
TabIndex = 28
Top = 6360
Width = 2775
End
Begin VB.ComboBox Combo3
Height = 300
Left = 2400
TabIndex = 18
Text = "Combo3"
Top = 4560
Width = 1215
End
Begin VB.ComboBox Combo2
Height = 300
Left = 2400
TabIndex = 16
Text = "Combo2"
Top = 3960
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Left = 2400
TabIndex = 15
Text = "Combo1"
Top = 1440
Width = 1215
End
Begin VB.OptionButton Option2
Caption = "女"
Height = 375
Left = 3480
Picture = "Form2.frx":1DDAE
TabIndex = 14
Top = 2640
Width = 615
End
Begin VB.OptionButton Option1
Caption = "男"
Height = 375
Left = 2400
Picture = "Form2.frx":3BB5C
TabIndex = 13
Top = 2640
Width = 615
End
Begin VB.TextBox Text5
Height = 1095
Left = 2400
TabIndex = 12
Top = 5040
Width = 5415
End
Begin VB.TextBox Text4
Height = 495
Left = 2400
TabIndex = 11
Top = 3240
Width = 1935
End
Begin VB.TextBox Text3
Height = 495
Left = 2400
TabIndex = 10
Top = 1920
Width = 1935
End
Begin VB.TextBox Text2
Height = 495
Left = 2400
MaxLength = 6
TabIndex = 9
Top = 720
Width = 1935
End
Begin VB.TextBox Text1
Height = 495
Left = 2400
TabIndex = 8
Top = 120
Width = 1935
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "%"
Height = 180
Left = 5760
TabIndex = 30
Top = 840
Width = 90
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = " e-mail "
Height = 180
Left = 1200
TabIndex = 27
Top = 6360
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 7
Left = 3960
TabIndex = 26
Top = 4680
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 6
Left = 3960
TabIndex = 25
Top = 4080
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 5
Left = 4560
TabIndex = 24
Top = 3360
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 4
Left = 4560
TabIndex = 23
Top = 2640
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 3
Left = 4560
TabIndex = 22
Top = 2040
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 2
Left = 3840
TabIndex = 21
Top = 1440
Width = 90
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*最长六位"
ForeColor = &H000000FF&
Height = 180
Index = 1
Left = 4560
TabIndex = 20
Top = 840
Width = 810
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "*"
ForeColor = &H000000FF&
Height = 180
Index = 0
Left = 4560
TabIndex = 19
Top = 120
Width = 90
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "兴趣爱好"
Height = 180
Left = 1080
TabIndex = 17
Top = 5160
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "职业"
Height = 180
Left = 1440
TabIndex = 7
Top = 4560
Width = 360
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学历"
Height = 180
Left = 1440
TabIndex = 6
Top = 3960
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "年龄"
Height = 180
Left = 1440
TabIndex = 5
Top = 3360
Width = 360
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "性别"
Height = 180
Left = 1440
TabIndex = 4
Top = 2760
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "答案"
Height = 180
Left = 1440
TabIndex = 3
Top = 2040
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密码提示问题"
Height = 180
Left = 840
TabIndex = 2
Top = 1440
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密码"
Height = 180
Left = 1440
TabIndex = 1
Top = 840
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "帐号"
Height = 180
Left = 1440
TabIndex = 0
Top = 240
Width = 360
End
End
Attribute VB_Name = "用户注册"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
Label12.Caption = "请填入用户名!"
Else
If Data1.Recordset.BOF And Data1.Recordset.EOF Then
Label12.Caption = "此用户可用,请完成以下操作!"
End If
Data1.Recordset.FindFirst ("帐号='" & Text1.Text & "'")
If Data1.Recordset.NoMatch Then
Label12.Caption = "此用户可用,请完成以下操作!"
Else
Label12.Caption = "该用户已存在!"
Into = MsgBox("该用户已存在,请重新输入用户名", vbYes + vbQuestion, "系统提示") = vbYes
Text1.Text = ""
End If
End If
End Sub
Private Sub Command2_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Combo1.Text = "" Or Combo2.Text = "" Or Combo3.Text = "" Then
inta = MsgBox("请如实填写用户信息!", , "温馨提示")
Else
If Option1.Value = True Then
xb = Option1.Caption
Else
xb = Option2.Caption
End If
Data1.Recordset.AddNew
Data1.Recordset.Fields("帐号") = Text1.Text
Data1.Recordset.Fields("密码") = Text2.Text
Data1.Recordset.Fields("密码Q") = Combo1.Text
Data1.Recordset.Fields("密码A") = Text3.Text
Data1.Recordset.Fields("性别") = xb
Data1.Recordset.Fields("年龄") = Text4.Text
Data1.Recordset.Fields("学历") = Combo2.Text
Data1.Recordset.Fields("职业") = Combo3.Text
Data1.Recordset.Update
inta = MsgBox("注册成功", vbYesNo, "温馨提示")
End If
End Sub
Private Sub Command3_Click()
Unload Me
登陆.Show
End Sub
Private Sub Form_Load()
Text2.PasswordChar = "*"
Data1.DatabaseName = "试题库.mdb"
Data1.RecordSource = "用户"
Data1.Refresh
Data2.DatabaseName = "试题库.mdb"
Data2.RecordSource = "密码Q"
Data2.Refresh
Data3.DatabaseName = "试题库.mdb"
Data3.RecordSource = "学历"
Data3.Refresh
Data4.DatabaseName = "试题库.mdb"
Data4.RecordSource = "职业"
Data4.Refresh
Call dateview
End Sub
Private Sub dateview()
Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
Combo1.AddItem Data2.Recordset.Fields("密码Q")
Data2.Recordset.MoveNext
Loop
Data3.Recordset.MoveFirst
Do Until Data3.Recordset.EOF
Combo2.AddItem Data3.Recordset.Fields("xueli")
Data3.Recordset.MoveNext
Loop
Data4.Recordset.MoveFirst
Do Until Data4.Recordset.EOF
Combo3.AddItem Data4.Recordset.Fields("zhiye")
Data4.Recordset.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -