📄 frmnewuser.frm
字号:
VERSION 5.00
Begin VB.Form newuser
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
Caption = "New User"
ClientHeight = 3735
ClientLeft = 3120
ClientTop = 1515
ClientWidth = 5925
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmnewuser.frx":0000
ScaleHeight = 3735
ScaleWidth = 5925
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox TexUserID
Height = 330
Left = 2625
TabIndex = 4
Top = 1260
Width = 2430
End
Begin VB.ComboBox Cmbusertype
Height = 315
ItemData = "frmnewuser.frx":49422
Left = 2640
List = "frmnewuser.frx":4942F
TabIndex = 3
Top = 2310
Width = 2415
End
Begin VB.TextBox TxtPassword
Height = 330
IMEMode = 3 'DISABLE
Left = 2625
PasswordChar = "*"
TabIndex = 2
Top = 1785
Width = 2430
End
Begin VB.CommandButton Command1
BackColor = &H80000009&
Caption = "C&reate"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2340
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 1
Top = 3120
Width = 1065
End
Begin VB.CommandButton Command2
BackColor = &H80000009&
Caption = "&Cancel"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 3360
MaskColor = &H00FFFFFF&
Style = 1 'Graphical
TabIndex = 0
Top = 3120
Width = 1035
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "User ID :"
BeginProperty Font
Name = "Arial"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000005&
Height = 270
Left = 1290
TabIndex = 7
Top = 1335
Width = 1305
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "User Type :"
BeginProperty Font
Name = "Arial"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000005&
Height = 270
Left = 1290
TabIndex = 6
Top = 2370
Width = 1320
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Password :"
BeginProperty Font
Name = "Arial"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000005&
Height = 270
Left = 1290
TabIndex = 5
Top = 1860
Width = 1320
End
End
Attribute VB_Name = "newuser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim RsLogin As New ADODB.Recordset
If RsLogin.State = adStateOpen Then RsLogin.Close
RsLogin.Open "select * from Login where UserId='" & Trim(TexUserID.Text) & "'", cnn, adOpenDynamic, adLockOptimistic
If RsLogin.RecordCount > 0 Then
MsgBox "This User ID is already exist.", vbExclamation + vbOKOnly, "Alert"
TexUserID.SetFocus
RsLogin.Close
Exit Sub
Else
With RsLogin
.AddNew
.Fields(0) = Val(TexUserID.Text)
.Fields(1) = Trim(TxtPassword.Text)
.Fields(2) = Trim(Cmbusertype.Text)
.Update
End With
If MsgBox("New user has created successfully, add new user more...? [Yes/No]", vbInformation + vbYesNo, "MDS") = vbYes Then
TexUserID.Text = ""
TxtPassword.Text = ""
TexUserID.SetFocus
Exit Sub
End If
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -