?? tjyh.frm
字號(hào):
VERSION 5.00
Begin VB.Form 添加用戶
Caption = "系統(tǒng)管理-添加用戶"
ClientHeight = 3555
ClientLeft = 60
ClientTop = 450
ClientWidth = 5715
LinkTopic = "Form2"
ScaleHeight = 3555
ScaleWidth = 5715
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "增加用戶"
Height = 3495
Left = 90
TabIndex = 0
Top = 0
Width = 5535
Begin VB.CheckBox Check1
Caption = "系統(tǒng)管理員"
Height = 495
Left = 240
TabIndex = 9
Top = 1320
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 350
Left = 3120
TabIndex = 8
Top = 2880
Width = 855
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 350
Left = 1560
TabIndex = 7
Top = 2880
Width = 855
End
Begin VB.TextBox Text3
Height = 270
Left = 3600
TabIndex = 6
Top = 1440
Width = 1695
End
Begin VB.TextBox Text2
Height = 270
Left = 3600
TabIndex = 5
Top = 720
Width = 1695
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
TabIndex = 4
Top = 720
Width = 1215
End
Begin VB.Label Label3
Caption = "確認(rèn)密碼:"
Height = 255
Left = 2640
TabIndex = 3
Top = 1440
Width = 975
End
Begin VB.Label Label2
Caption = "密碼:"
Height = 255
Left = 3000
TabIndex = 2
Top = 720
Width = 495
End
Begin VB.Label Label1
Caption = "用戶名:"
Height = 255
Left = 240
TabIndex = 1
Top = 720
Width = 735
End
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 Trim(Text1.Text) = "" Then
MsgBox "用戶名不能為空!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
Dim mrc As ADODB.Recordset
txtsql = "select * from 用戶 where 用戶名='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = False Then
MsgBox " 已存在該用戶!", vbExclamation + vbOKOnly, "警告"
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Check1.Value = 0
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "密碼不能為空!", vbExclamation + vbOKOnly, "警告"
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "確認(rèn)密碼不能為空!", vbExclamation + vbOKOnly, "警告"
Text3.SetFocus
Exit Sub
End If
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "確認(rèn)密碼不正確!", vbExclamation + vbOKOnly, "警告"
Text3.SetFocus
Exit Sub
End If
Dim qx As String
If Check1.Value = 1 Then
qx = "1"
Else
qx = "0"
End If
txtsql = "select * from 用戶"
Set mrc = ExecuteSQL(txtsql)
mrc.AddNew
mrc.Fields(0) = Trim(Text1.Text)
mrc.Fields(1) = Trim(Text2.Text)
mrc.Fields(2) = qx
mrc.Update
MsgBox " 用戶添加成功!", vbExclamation + vbOKOnly, "警告"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Check1.Value = 0
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -