?? form3.frm
字號:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SMARTXPBUTTON.OCX"
Begin VB.Form Form3
BackColor = &H00E0E0E0&
Caption = "添加用戶"
ClientHeight = 3195
ClientLeft = 4605
ClientTop = 5250
ClientWidth = 4680
Icon = "Form3.frx":0000
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
Begin SmartXPButton.XpButton command2
Height = 375
Left = 2520
TabIndex = 9
Top = 2520
Width = 975
_ExtentX = 1720
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退出 "
PictureSmoothBackColor= 13882323
End
Begin SmartXPButton.XpButton command1
Height = 375
Left = 720
TabIndex = 8
Top = 2520
Width = 975
_ExtentX = 1720
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "確定"
PictureSmoothBackColor= 13882323
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
TabIndex = 7
Top = 1680
Width = 1575
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 6
Top = 1200
Width = 1695
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 5
Top = 720
Width = 1695
End
Begin VB.TextBox Text1
Height = 270
Left = 1800
TabIndex = 4
Top = 240
Width = 1695
End
Begin VB.Label Label4
BackColor = &H00E0E0E0&
Caption = "選擇權限"
Height = 375
Left = 360
TabIndex = 3
Top = 1800
Width = 855
End
Begin VB.Label Label3
BackColor = &H00E0E0E0&
Caption = "確認密碼"
Height = 375
Left = 360
TabIndex = 2
Top = 1320
Width = 975
End
Begin VB.Label Label2
BackColor = &H00E0E0E0&
Caption = "輸入密碼"
Height = 375
Left = 360
TabIndex = 1
Top = 720
Width = 975
End
Begin VB.Label Label1
BackColor = &H00E0E0E0&
Caption = "輸入用戶名"
Height = 255
Left = 360
TabIndex = 0
Top = 240
Width = 975
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub command1_Click()
Dim sql As String
Dim rs_add As New ADODB.Recordset
If Trim(Text1.Text) = "" Then
MsgBox "用戶名不能為空", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Exit Sub
Else
sql = "select * from 系統信息"
rs_add.Open sql, conn, adOpenKeyset, adLockPessimistic
While (rs_add.EOF = False)
If Trim(rs_add.Fields(0)) = Trim(Text1.Text) Then
MsgBox "已有這個用戶", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
Exit Sub
Else
rs_add.MoveNext
End If
Wend
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "兩次密碼不一致", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Text2.Text = ""
Text3.Text = ""
Exit Sub
ElseIf Trim(Combo1.Text) <> "system" And Trim(Combo1.Text) <> "guest" Then
MsgBox "請選擇正確的用戶權限", vbOKOnly + vbExclamation, ""
Combo1.SetFocus
Combo1.Text = ""
Exit Sub
Else
rs_add.AddNew
rs_add.Fields(0) = Text1.Text
rs_add.Fields(1) = Text2.Text
rs_add.Fields(2) = Combo1.Text
rs_add.Update
rs_add.Close
MsgBox "添加用戶成功", vbOKOnly + vbExclamation, ""
Me.Hide
End If
End If
End Sub
Private Sub command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Combo1.AddItem "system"
Combo1.AddItem "guest"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -