📄 admin.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Admin
Caption = "操作员管理"
ClientHeight = 4815
ClientLeft = 60
ClientTop = 465
ClientWidth = 6105
Icon = "Admin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 4815
ScaleWidth = 6105
Begin MSAdodcLib.Adodc Adodc2
Height = 495
Left = 2760
Top = 3960
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=CARS"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "CARS"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "权限信息表"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 4560
TabIndex = 9
Top = 960
Width = 1335
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 360
Top = 3960
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=CARS"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "CARS"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "权限信息表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Admin.frx":319A
Height = 2055
Left = 120
TabIndex = 10
Top = 2640
Width = 5895
_ExtentX = 10398
_ExtentY = 3625
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 4560
TabIndex = 11
Top = 1800
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 375
Left = 4560
TabIndex = 8
Top = 360
Width = 1335
End
Begin VB.Frame Frame1
Caption = "新增操作员资料"
Height = 2295
Left = 120
TabIndex = 0
Top = 120
Width = 4095
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "Admin.frx":31AF
Height = 330
Left = 1560
TabIndex = 7
Top = 1800
Width = 1575
_ExtentX = 2778
_ExtentY = 582
_Version = 393216
ListField = "权限"
Text = "选择权限"
End
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 6
Top = 1320
Width = 1575
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 5
Top = 840
Width = 1575
End
Begin VB.TextBox Text1
Height = 270
Left = 1560
TabIndex = 4
Top = 360
Width = 2055
End
Begin VB.Label Label4
Caption = "权限设置:"
Height = 255
Left = 240
TabIndex = 12
Top = 1800
Width = 975
End
Begin VB.Label Label3
Caption = "确认密码:"
Height = 255
Left = 240
TabIndex = 3
Top = 1320
Width = 1095
End
Begin VB.Label Label2
Caption = "密 码:"
Height = 255
Left = 240
TabIndex = 2
Top = 840
Width = 1095
End
Begin VB.Label Label1
Caption = "操作员名称:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 1095
End
End
Begin VB.Line Line1
X1 = 0
X2 = 6120
Y1 = 2520
Y2 = 2520
End
End
Attribute VB_Name = "Admin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public adoCon As New ADODB.Connection
Public rs As New ADODB.Recordset
Public Sub main()
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=bai;password=052606241;Initial Catalog=CARS;Data Source=5c92669bd5be43c"
End Sub
Private Sub Command1_Click()
Call main
If Text1.Text = "" Then
MsgBox "操作员名称不能为空!", 64, "提示信息"
Text1.SetFocus: Exit Sub
End If
If Text2.Text = "" Then
MsgBox "密码不能为空!", 64, "提示信息"
Text2.SetFocus: Exit Sub
End If
If Text3.Text <> Text2.Text Then
MsgBox "两次输入密码值不相等,请重新输入!", 17, "提示信息"
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus: Exit Sub
End If
rs.Open "select * from 权限信息表", adoCon, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields("操作员名称") = Text1.Text
rs.Fields("密码") = Text2.Text
rs.Fields("权限") = DataCombo1.Text
rs.Update
MsgBox "操作员资料保存成功!", 0, "提示信息"
Adodc1.Refresh
rs.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.EOF = False Then
c = MsgBox("您确认删除该记录么?", 17, "提示信息")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
MsgBox "该记录已成功删除!", 0, "提示信息"
Else
End If
Else
MsgBox "当前数据中已经没有可删除的记录", 17, "提示信息"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -