?? frmnewuser.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmNewUser
BackColor = &H80000007&
Caption = "Form1"
ClientHeight = 1890
ClientLeft = 60
ClientTop = 345
ClientWidth = 6855
LinkTopic = "Form1"
ScaleHeight = 1890
ScaleWidth = 6855
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Left = 2040
TabIndex = 3
Top = 120
Width = 2415
End
Begin VB.ComboBox cmb
Height = 300
Left = 2040
TabIndex = 2
Top = 840
Width = 2415
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 345
Left = 3240
TabIndex = 1
Top = 1440
Width = 975
End
Begin VB.CommandButton cmdFinally
Caption = "完 成"
Default = -1 'True
Height = 345
Left = 1920
TabIndex = 0
Top = 1440
Width = 975
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "請(qǐng)入新用戶的帳號(hào):"
ForeColor = &H00FFFFFF&
Height = 180
Index = 4
Left = 360
TabIndex = 7
Top = 240
Width = 1620
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "請(qǐng)入新用戶的權(quán)限:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 0
Left = 360
TabIndex = 6
Top = 960
Width = 1620
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "(用戶名不能長(zhǎng)于12位)"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 4680
TabIndex = 5
Top = 240
Width = 1800
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "(用戶權(quán)限不能用其它的)"
ForeColor = &H00FFFFFF&
Height = 180
Index = 3
Left = 4680
TabIndex = 4
Top = 960
Width = 1980
End
End
Attribute VB_Name = "frmNewUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
Public password As String
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdFinally_Click()
Set rst = New Recordset
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'判斷用戶輸入的正確性↓
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If Len(txt.Text) = 0 Then
MsgBox "新用戶名不能為空!"
Exit Sub
End If
If Len(txt.Text) > 12 Then
MsgBox "用戶名不能長(zhǎng)于12位!"
Exit Sub
End If
If cmb.Text <> "admin" And cmb.Text <> "user" Then
MsgBox "用戶權(quán)限設(shè)置錯(cuò)誤,不能選擇下拉框以外的!"
Exit Sub
End If
'''''''''''''''''''''''''''''用戶ID輸入的正確性↓
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
Dim getUser As Boolean
getUser = False
On Error GoTo errUser
rst.Open "select name from users", con, adOpenDynamic, adLockOptimistic
rst.MoveFirst
getUser = True
errUser:
If getUser = True Then
Do While Not rst.EOF
If rst!name = txt.Text Then
MsgBox "此用戶名已經(jīng)存在,請(qǐng)換一個(gè)!"
Exit Sub
End If
rst.MoveNext
Loop
End If
rst.Close
con.Close
frmIBNU.Show
End Sub
Private Sub Form_Load()
cmb.AddItem ("admin")
cmb.AddItem ("user")
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -