?? 新用戶注冊.frm
字號:
VERSION 5.00
Begin VB.Form 新用戶注冊
BorderStyle = 1 'Fixed Single
Caption = "新用戶注冊"
ClientHeight = 3705
ClientLeft = 45
ClientTop = 435
ClientWidth = 3930
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3705
ScaleWidth = 3930
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 9
Top = 1680
Width = 1575
End
Begin VB.CommandButton Command3
Caption = "清空"
Height = 375
Left = 1680
TabIndex = 8
Top = 3000
Width = 735
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 7
Top = 3000
Width = 735
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 600
TabIndex = 6
Top = 3000
Width = 735
End
Begin VB.TextBox Text3
Height = 375
Left = 1800
TabIndex = 4
Top = 2280
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 3
Top = 1080
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Left = 1800
TabIndex = 1
Top = 480
Width = 1575
End
Begin VB.Label Label4
Caption = "再次輸入密碼:"
Height = 375
Left = 240
TabIndex = 10
Top = 1800
Width = 1335
End
Begin VB.Label Label3
Caption = "用戶姓名:"
Height = 255
Left = 600
TabIndex = 5
Top = 2400
Width = 975
End
Begin VB.Label Label2
Caption = "用戶密碼:"
Height = 255
Left = 600
TabIndex = 2
Top = 1200
Width = 1095
End
Begin VB.Label Label1
Caption = "用戶ID:"
Height = 255
Left = 720
TabIndex = 0
Top = 600
Width = 975
End
End
Attribute VB_Name = "新用戶注冊"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Initial_Add()
Dim Rst As New ADODB.Recordset
Dim strSQL As String
Me.Text1.Text = ""
Me.Text2.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
End Sub
Private Sub Command1_Click()
SuppInfo_Add
End Sub
Private Sub Command3_Click()
Initial_Add
End Sub
Private Sub Form_Load()
Me.Command1.Default = True
Initial_Add
Exit Sub
End
End Sub
Private Function SuppInfo_Add() As Boolean
Dim Rst As New ADODB.Recordset
Dim strSQL As String
Dim intRst As Integer
SuppInfo_Add = False
If CheckFaceIsOk = False Then
Exit Function
End If
strSQL = "SELECT * FROM 登錄 "
Rst.Open strSQL, cnnDatabase, adOpenDynamic, adLockOptimistic
If Me.Text2.Text = Me.Text4.Text Then
Rst.AddNew
Rst.Fields("用戶ID").Value = Me.Text1.Text
Rst.Fields("密碼").Value = Me.Text2.Text
Rst.Fields("用戶名").Value = Me.Text3.Text
Rst.Update
MsgBox "添加新的用戶信息成功!", vbInformation, "操作成功-"
Else
MsgBox "兩次輸入的密碼不一致!", vbInformation, "錯誤-"
Me.Text2.Text = ""
Me.Text4.Text = ""
End If
Set Rst = Nothing
Initial_Add
SuppInfo_Add = False
Exit Function
End Function
Private Function CheckFaceIsOk() As Boolean
Dim intText As Integer
Dim strText As String
CheckFaceIsOk = True
If Me.Text1 = "" Then
MsgBox "用戶ID不能為空!", vbCritical, Me.Caption
Me.Text1.SetFocus
CheckFaceIsOk = False
Exit Function
End If
If Me.Text2 = "" Then
MsgBox "用戶密碼不能為空!", vbCritical, Me.Caption
Me.Text2.SetFocus
CheckFaceIsOk = False
Exit Function
End If
If Me.Text3 = "" Then
MsgBox "用戶姓名不能為空!", vbCritical, Me.Caption
Me.Text3.SetFocus
CheckFaceIsOk = False
Exit Function
End If
End Function
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -