📄 newsysacc.frm
字号:
VERSION 5.00
Begin VB.Form newSysacc
Caption = "新建系统用户"
ClientHeight = 3840
ClientLeft = 60
ClientTop = 450
ClientWidth = 7035
LinkTopic = "Form1"
ScaleHeight = 3840
ScaleWidth = 7035
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Index = 1
Left = 1680
PasswordChar = "*"
TabIndex = 8
Top = 1800
Width = 2175
End
Begin VB.TextBox Text1
Height = 270
Index = 0
Left = 1680
TabIndex = 7
Top = 1440
Width = 2175
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "newSysacc.frx":0000
Left = 1680
List = "newSysacc.frx":000A
Style = 2 'Dropdown List
TabIndex = 6
Top = 2160
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3360
TabIndex = 5
Top = 3120
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1440
TabIndex = 4
Top = 3120
Width = 1095
End
Begin VB.Label Label4
Caption = "权限:"
Height = 255
Left = 840
TabIndex = 3
Top = 2160
Width = 855
End
Begin VB.Label Label3
Caption = "密码:"
Height = 255
Left = 840
TabIndex = 2
Top = 1800
Width = 735
End
Begin VB.Label Label2
Caption = "用户名:"
Height = 255
Left = 720
TabIndex = 1
Top = 1440
Width = 1095
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "新建系统用户"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 0
Top = 360
Width = 3735
End
End
Attribute VB_Name = "newSysacc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim str As String
str = "select * from Susers"
Set cn = New adodb.Connection
Dim rst As Recordset
Set rst = New Recordset
cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=(local)"
cn.Open
rst.Open str, cn, adOpenDynamic, adLockOptimistic
''''''''''''''''''
'核对用户名
''''''''''''''''''
For i = 0 To 1 '如果某项输入为空,则提示
If Text1(i).Text = "" Then
MsgBox "请将各项填写完整", vbExclamation, "错误"
Exit Sub
End If
Next i
If Combo1.Text = "" Then
MsgBox "请将各项填写完整", vbExclamation, "错误"
Exit Sub
End If
rst.MoveFirst
Do While Not rst.EOF
If Trim(rst.Fields("ID")) = Text1(0).Text Then
MsgBox ("该用户名已经存在,请重新输入!")
rst.Close
cn.Close
Exit Sub
End If
rst.MoveNext
Loop
rst.AddNew
rst.Fields("ID") = Text1(0).Text
rst.Fields("Spassword") = Text1(1).Text
rst.Fields("Spower") = Combo1.Text
rst.Update
rst.Close
cn.Close
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -