📄 zhuce.frm
字号:
VERSION 5.00
Begin VB.Form zhuce
BorderStyle = 4 'Fixed ToolWindow
Caption = "用户注册"
ClientHeight = 3765
ClientLeft = 4515
ClientTop = 3570
ClientWidth = 3990
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3765
ScaleWidth = 3990
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 1920
TabIndex = 8
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 480
TabIndex = 7
Top = 2160
Width = 1095
End
Begin VB.TextBox Text3
Height = 375
Left = 1200
TabIndex = 5
Top = 1440
Width = 1695
End
Begin VB.TextBox Text2
DataField = "密码"
DataSource = "Adodc1"
Height = 375
Left = 1200
TabIndex = 4
Top = 960
Width = 1695
End
Begin VB.TextBox Text1
DataField = "用户名"
DataSource = "Adodc1"
Height = 375
Left = 1200
TabIndex = 3
Top = 480
Width = 1695
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "*必填"
ForeColor = &H000000FF&
Height = 180
Left = 3000
TabIndex = 6
Top = 600
Width = 450
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "确认密码"
Height = 180
Left = 360
TabIndex = 2
Top = 1560
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密码"
Height = 180
Left = 600
TabIndex = 1
Top = 1080
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名"
Height = 180
Left = 600
TabIndex = 0
Top = 600
Width = 540
End
End
Attribute VB_Name = "zhuce"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "用户名不能为空!!!"
ElseIf Text2.Text = "" Then
MsgBox "密码不能为空!"
ElseIf Text2.Text <> Text3.Text Then
MsgBox "2次密码不一样,请重新输入!"
Exit Sub
Else:
Dim conn As New ADODB.Connection
Dim rs As New Recordset
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\教程\VB\大作业\新建文件夹\user.mdb;Persist Security Info=False"
conn.Open
rs.Open "select * from 用户信息", conn, 1, 3
rs.MoveLast
rs.AddNew
rs.Fields("用户名").Value = Text1.Text
rs.Fields("密码").Value = Text2.Text
rs.Update
End If
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
MsgBox "注册成功"
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -