📄 frmuser.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form FrmUser
Caption = "用户管理"
ClientHeight = 6615
ClientLeft = 60
ClientTop = 450
ClientWidth = 6795
Icon = "FrmUser.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 6615
ScaleWidth = 6795
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "编辑"
Height = 3255
Left = 120
TabIndex = 2
Top = 3240
Width = 6615
Begin VB.CheckBox Check1
Caption = "设备统计"
Height = 375
Index = 7
Left = 4920
TabIndex = 19
Top = 2520
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "设备上线"
Height = 375
Index = 6
Left = 3480
TabIndex = 18
Top = 2520
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "设备操作"
Height = 375
Index = 5
Left = 2040
TabIndex = 17
Top = 2520
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "设备登记"
Height = 375
Index = 4
Left = 960
TabIndex = 16
Top = 2520
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "设备资料修改"
Height = 375
Index = 3
Left = 4920
TabIndex = 15
Top = 2160
Width = 1575
End
Begin VB.CheckBox Check1
Caption = "设备查看"
Height = 375
Index = 2
Left = 3480
TabIndex = 14
Top = 2160
Width = 1815
End
Begin VB.CheckBox Check1
Caption = "基本资料管理"
Height = 375
Index = 1
Left = 2040
TabIndex = 13
Top = 2160
Width = 1815
End
Begin VB.CheckBox Check1
Caption = "用户管理"
Height = 375
Index = 0
Left = 960
TabIndex = 12
Top = 2160
Width = 1095
End
Begin VB.TextBox txtTruename
DataField = "manufacturer_name"
DataSource = "Adodc1"
Height = 390
Left = 960
TabIndex = 10
Top = 1680
Width = 2175
End
Begin VB.TextBox txtPassword
DataField = "manufacturer_name"
DataSource = "Adodc1"
Height = 390
Left = 960
TabIndex = 9
Top = 1200
Width = 2175
End
Begin VB.TextBox txtUsername
DataField = "manufacturer_name"
DataSource = "Adodc1"
Height = 390
Left = 960
TabIndex = 4
Top = 720
Width = 2175
End
Begin VB.TextBox txtId
BackColor = &H80000011&
DataField = "manufacturer_id"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 390
Left = 960
TabIndex = 3
Top = 240
Width = 2175
End
Begin VB.Label Label5
Caption = "权限:"
Height = 255
Left = 240
TabIndex = 11
Top = 2280
Width = 855
End
Begin VB.Label Label4
Caption = "真名:"
Height = 255
Left = 240
TabIndex = 8
Top = 1800
Width = 855
End
Begin VB.Label Label2
Caption = "密码:"
Height = 255
Left = 240
TabIndex = 7
Top = 1320
Width = 855
End
Begin VB.Label Label3
Caption = "帐号:"
Height = 255
Left = 240
TabIndex = 6
Top = 840
Width = 855
End
Begin VB.Label Label1
Caption = "ID:"
Height = 255
Left = 240
TabIndex = 5
Top = 360
Width = 375
End
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 810
Left = 0
TabIndex = 0
Top = 0
Width = 6795
_ExtentX = 11986
_ExtentY = 1429
ButtonWidth = 1032
ButtonHeight = 1376
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 5
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "新建"
Key = "新建"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
Key = "保存"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "删除"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
Key = "关闭"
ImageIndex = 4
EndProperty
EndProperty
BorderStyle = 1
Begin MSComctlLib.ImageList ImageList1
Left = 4680
Top = 120
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 4
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmUser.frx":08CA
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmUser.frx":11A4
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmUser.frx":1A7E
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmUser.frx":2358
Key = ""
EndProperty
EndProperty
End
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2295
Left = 0
TabIndex = 1
Top = 840
Width = 6735
_ExtentX = 11880
_ExtentY = 4048
_Version = 393216
RowHeightMin = 315
WordWrap = -1 'True
HighLight = 0
FillStyle = 1
End
End
Attribute VB_Name = "FrmUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/09/25
'描 述:江苏大学网络信息中心网络管理系统 - v1.0 Beta
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Dim txtSQL As String
Dim MsgText As String
Dim HasError As Boolean
Private WithEvents mMSFlexGrid1 As cFlexGridBinder
Attribute mMSFlexGrid1.VB_VarHelpID = -1
Private Sub Form_Load()
Grid_Init
Grid_Fill
End Sub
Sub Grid_Init()
With MSFlexGrid1
.FormatString = "|<编号|<帐号|<真名"
.ColWidth(0) = 0
.ColWidth(1) = 1000
.ColWidth(2) = 2200
.ColWidth(3) = 3200
.Rows = 1
End With
Set mMSFlexGrid1 = New cFlexGridBinder
With mMSFlexGrid1
Set .Grid = MSFlexGrid1
.Editable = True
.EditOnMouse = emeNone
.FullRowSelect = True
End With
End Sub
Sub Grid_Fill()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
txtSQL = "select * from tbl_user"
Set rst = ExecuteSQL(txtSQL, MsgText, HasError)
MSFlexGrid1.Rows = 1
Do While Not rst.EOF
MSFlexGrid1.AddItem vbTab & rst.Fields("user_id") & vbTab & rst.Fields("username") & vbTab & rst.Fields("truename")
rst.MoveNext
Loop
End Sub
Private Sub MSFlexGrid1_Click()
If mMSFlexGrid1.HighlightedRow = 0 Then
Exit Sub
End If
Set mrc = ExecuteSQL("select * from tbl_user where user_id = " & MSFlexGrid1.TextMatrix(mMSFlexGrid1.HighlightedRow, 1), MsgText, HasError)
If mrc.EOF = False Then
txtId = mrc.Fields("user_id")
txtUsername = mrc.Fields("username")
txtPassword = mrc.Fields("password")
txtTruename = mrc.Fields("truename")
If mrc.Fields("priv_yhgl") = True Then Check1(0).Value = 1 Else Check1(0).Value = 0
If mrc.Fields("priv_jbzlgl") = True Then Check1(1).Value = 1 Else Check1(1).Value = 0
If mrc.Fields("priv_sbck") = True Then Check1(2).Value = 1 Else Check1(2).Value = 0
If mrc.Fields("priv_sbzlxg") = True Then Check1(3).Value = 1 Else Check1(3).Value = 0
If mrc.Fields("priv_sbdj") = True Then Check1(4).Value = 1 Else Check1(4).Value = 0
If mrc.Fields("priv_sbcz") = True Then Check1(5).Value = 1 Else Check1(5).Value = 0
If mrc.Fields("priv_sbsx") = True Then Check1(6).Value = 1 Else Check1(6).Value = 0
If mrc.Fields("priv_sbtj") = True Then Check1(7).Value = 1 Else Check1(7).Value = 0
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error Resume Next
Select Case Button.key
Case "新建"
txtId = ""
txtUsername = ""
txtPassword = ""
txtTruename = ""
Check1(0).Value = 0
Check1(1).Value = 0
Check1(2).Value = 0
Check1(3).Value = 0
Check1(4).Value = 0
Check1(5).Value = 0
Check1(6).Value = 0
Check1(7).Value = 0
Case "保存"
If txtId.Text = "" Then
Set mrc = ExecuteSQL("select top 1 user_id from tbl_user order by user_id desc", MsgText, HasError)
If mrc.EOF = False Then
newid = mrc.Fields("user_id") + 1
Else
newid = 1
End If
txtSQL = "insert into tbl_user values("
txtSQL = txtSQL & Quote(newid) & ","
txtSQL = txtSQL & Quote(txtUsername.Text) & ","
txtSQL = txtSQL & Quote(txtPassword.Text) & ","
txtSQL = txtSQL & Quote(txtTruename.Text) & ","
txtSQL = txtSQL & Quote(Check1(0).Value) & ","
txtSQL = txtSQL & Quote(Check1(1).Value) & ","
txtSQL = txtSQL & Quote(Check1(2).Value) & ","
txtSQL = txtSQL & Quote(Check1(3).Value) & ","
txtSQL = txtSQL & Quote(Check1(4).Value) & ","
txtSQL = txtSQL & Quote(Check1(5).Value) & ","
txtSQL = txtSQL & Quote(Check1(6).Value) & ","
txtSQL = txtSQL & Quote(Check1(7).Value)
txtSQL = txtSQL & ")"
Set mrc = ExecuteSQL(txtSQL, MsgText, HasError)
Else
txtSQL = "update tbl_user set "
txtSQL = txtSQL & "username=" & Quote(txtUsername.Text)
txtSQL = txtSQL & ",password=" & Quote(txtPassword.Text)
txtSQL = txtSQL & ",truename=" & Quote(txtTruename.Text)
txtSQL = txtSQL & ",priv_yhgl=" & Quote(Check1(0).Value)
txtSQL = txtSQL & ",priv_jbzlgl=" & Quote(Check1(1).Value)
txtSQL = txtSQL & ",priv_sbck=" & Quote(Check1(2).Value)
txtSQL = txtSQL & ",priv_sbzlxg=" & Quote(Check1(3).Value)
txtSQL = txtSQL & ",priv_sbdj=" & Quote(Check1(4).Value)
txtSQL = txtSQL & ",priv_sbcz=" & Quote(Check1(5).Value)
txtSQL = txtSQL & ",priv_sbsx=" & Quote(Check1(6).Value)
txtSQL = txtSQL & ",priv_sbtj=" & Quote(Check1(7).Value)
txtSQL = txtSQL & " where user_id =" & Quote(txtId)
Set mrc = ExecuteSQL(txtSQL, MsgText, HasError)
End If
Grid_Fill
Case "删除"
txtSQL = "delete from tbl_user "
txtSQL = txtSQL & " where user_id =" & Quote(txtId)
Set mrc = ExecuteSQL(txtSQL, MsgText, HasError)
Grid_Fill
mMSFlexGrid1.HighlightedRow = 0
Case "关闭"
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -