?? 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 "用戶名不能為空?。。?quot;
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 + -