?? frmuser.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"
Begin VB.Form frmUser
BorderStyle = 3 'Fixed Dialog
Caption = "用戶管理"
ClientHeight = 4680
ClientLeft = 45
ClientTop = 435
ClientWidth = 7275
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4680
ScaleWidth = 7275
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command4
Caption = "退出"
Height = 375
Left = 5880
TabIndex = 8
Top = 1080
Width = 975
End
Begin VB.CommandButton Command3
Caption = "修改"
Height = 375
Left = 5880
TabIndex = 7
Top = 480
Width = 975
End
Begin VB.CommandButton Command2
Caption = "刪除"
Height = 375
Left = 4560
TabIndex = 6
Top = 1080
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 4560
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 2280
TabIndex = 2
Top = 1080
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 2280
TabIndex = 1
Top = 480
Width = 1815
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 4440
Top = 120
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 582
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dock.mdb;Persist Security Info=False;Jet OLEDB:Database Password=xiao"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dock.mdb;Persist Security Info=False;Jet OLEDB:Database Password=xiao"
OLEDBFile = ""
DataSourceName = ""
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 = "frmUser.frx":0000
Height = 2775
Left = 240
TabIndex = 0
Top = 1680
Width = 6735
_ExtentX = 11880
_ExtentY = 4895
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
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 = 3
BeginProperty Column00
DataField = "ID"
Caption = "ID"
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
BeginProperty Column02
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
Object.Visible = 0 'False
ColumnWidth = 1094.74
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
BeginProperty Column02
ColumnWidth = 2085.166
EndProperty
EndProperty
End
Begin VB.Label Label2
Caption = "密碼"
Height = 375
Left = 600
TabIndex = 4
Top = 1080
Width = 975
End
Begin VB.Label Label1
Caption = "用戶名"
Height = 375
Left = 600
TabIndex = 3
Top = 480
Width = 1095
End
End
Attribute VB_Name = "frmUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "系統管理員" Then Beep: Exit Sub
If Text1.Text <> "" And Text2.Text <> "" Then
With Adodc1.Recordset
.AddNew
.Fields(1).Value = Text1.Text
.Fields(2).Value = Text2.Text
If Not .EOF Then .MoveNext
.Requery
End With
Else
MsgBox "數據不全!"
End If
End Sub
Private Sub Command2_Click()
With Adodc1.Recordset
If .Fields(1).Value <> "系統管理員" Then
If Not .EOF Then .Delete
Else
MsgBox "不能刪除管理員!"
End If
End With
End Sub
Private Sub Command3_Click()
If Text1.Text <> "" And Text2.Text <> "" Then
With Adodc1.Recordset
If .Fields(1).Value <> "系統管理員" Then
If Not .EOF Then
.Fields(1).Value = Text1.Text
.Fields(2).Value = Text2.Text
.Update
End If
Else
If Not .EOF Then
.Fields(2).Value = Text2.Text
.Update
MsgBox "不能修改系統管理員!但密碼已修改為:" & Text2.Text
End If
End If
End With
Else
MsgBox "數據不全!"
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
On Error Resume Next
With Adodc1.Recordset
Text1.Text = .Fields(1).Value
Text2.Text = .Fields(2).Value
End With
End Sub
Private Sub Form_Load()
With Adodc1
.CommandType = adCmdText
.ConnectionString = getDbStr
.RecordSource = "select * from 用戶表"
.Refresh
End With
DataGrid1.Columns.Item(0).Width = 0
End Sub
Private Sub Text1_Change()
Call chkTxt(Text1)
End Sub
Private Sub Text2_Change()
Call chkTxt(Text2)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -