?? user_frm.frm
字號:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "tabctl32.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form user_frm
Caption = "用戶管理窗體"
ClientHeight = 8265
ClientLeft = 60
ClientTop = 345
ClientWidth = 11430
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "user_frm.frx":0000
ScaleHeight = 8265
ScaleWidth = 11430
WindowState = 2 'Maximized
Begin TabDlg.SSTab SSTab1
Height = 6375
Left = 600
TabIndex = 0
Top = 720
Width = 9765
_ExtentX = 17224
_ExtentY = 11245
_Version = 393216
Tab = 1
TabHeight = 520
WordWrap = 0 'False
TabCaption(0) = "用戶信息"
TabPicture(0) = "user_frm.frx":52DAB
Tab(0).ControlEnabled= 0 'False
Tab(0).Control(0)= "DataGrid1"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).ControlCount= 1
TabCaption(1) = "修改密碼"
TabPicture(1) = "user_frm.frx":52DC7
Tab(1).ControlEnabled= -1 'True
Tab(1).Control(0)= "Label1"
Tab(1).Control(0).Enabled= 0 'False
Tab(1).Control(1)= "Label2"
Tab(1).Control(1).Enabled= 0 'False
Tab(1).Control(2)= "Text1"
Tab(1).Control(2).Enabled= 0 'False
Tab(1).Control(3)= "Text2"
Tab(1).Control(3).Enabled= 0 'False
Tab(1).Control(4)= "Command1"
Tab(1).Control(4).Enabled= 0 'False
Tab(1).Control(5)= "command2"
Tab(1).Control(5).Enabled= 0 'False
Tab(1).Control(6)= "Command6"
Tab(1).Control(6).Enabled= 0 'False
Tab(1).ControlCount= 7
TabCaption(2) = "添加用戶"
TabPicture(2) = "user_frm.frx":52DE3
Tab(2).ControlEnabled= 0 'False
Tab(2).Control(0)= "Label3"
Tab(2).Control(0).Enabled= 0 'False
Tab(2).Control(1)= "Label4"
Tab(2).Control(1).Enabled= 0 'False
Tab(2).Control(2)= "Label5"
Tab(2).Control(2).Enabled= 0 'False
Tab(2).Control(3)= "Text3"
Tab(2).Control(3).Enabled= 0 'False
Tab(2).Control(4)= "Text4"
Tab(2).Control(4).Enabled= 0 'False
Tab(2).Control(5)= "Text5"
Tab(2).Control(5).Enabled= 0 'False
Tab(2).Control(6)= "Command3"
Tab(2).Control(6).Enabled= 0 'False
Tab(2).Control(7)= "Command4"
Tab(2).Control(7).Enabled= 0 'False
Tab(2).Control(8)= "Command5"
Tab(2).Control(8).Enabled= 0 'False
Tab(2).ControlCount= 9
Begin VB.CommandButton Command6
Caption = "退出"
Height = 735
Left = 6960
TabIndex = 17
Top = 4680
Width = 1815
End
Begin VB.CommandButton Command5
Caption = "退出"
Height = 735
Left = -68160
TabIndex = 16
Top = 5160
Width = 1815
End
Begin VB.CommandButton Command4
Caption = "取消"
Height = 780
Left = -71040
TabIndex = 15
Top = 5160
Width = 1815
End
Begin VB.CommandButton Command3
Caption = "確認(rèn)"
Height = 735
Left = -74040
TabIndex = 14
Top = 5160
Width = 1815
End
Begin VB.TextBox Text5
Height = 735
Left = -70800
TabIndex = 13
Top = 3960
Width = 2175
End
Begin VB.TextBox Text4
Height = 735
Left = -70800
TabIndex = 11
Top = 2520
Width = 2055
End
Begin VB.TextBox Text3
Height = 735
Left = -70800
TabIndex = 9
Top = 960
Width = 2055
End
Begin VB.CommandButton command2
Caption = "取消"
Height = 735
Left = 4080
TabIndex = 7
Top = 4680
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "確認(rèn)"
Height = 735
Left = 1080
TabIndex = 6
Top = 4680
Width = 1815
End
Begin VB.TextBox Text2
Height = 615
Left = 3720
TabIndex = 5
Top = 2880
Width = 2775
End
Begin VB.TextBox Text1
Height = 615
Left = 3720
TabIndex = 3
Top = 1200
Width = 2895
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "user_frm.frx":52DFF
Height = 3015
Left = -74520
TabIndex = 1
Top = 720
Width = 8535
_ExtentX = 15055
_ExtentY = 5318
_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.Label Label5
AutoSize = -1 'True
Caption = "確認(rèn)密碼:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = -72840
TabIndex = 12
Top = 4200
Width = 1425
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "新密碼:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = -72840
TabIndex = 10
Top = 2760
Width = 1140
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "新用戶名:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = -72960
TabIndex = 8
Top = 1200
Width = 1425
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "確認(rèn)密碼:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1920
TabIndex = 4
Top = 3120
Width = 1200
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "新密碼:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1920
TabIndex = 2
Top = 1440
Width = 960
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 4560
Top = 7560
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\050531123賈晨微\db1.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\050531123賈晨微\db1.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "pwd"
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
End
Attribute VB_Name = "user_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim con As ADODB.Connection
Dim mrc As ADODB.Recordset
Private Sub Command3_Click()
'保存記錄
Dim myrs As New ADODB.Recordset
Dim query As String
myrs.Open "SELECT * FROM pwd", con, adOpenDynamic, adLockOptimistic, adCmdText
myrs.AddNew
If Not Testtxt(Text3.Text) Then
MsgBox "用戶名不能為空!"
Text1.SetFocus
Exit Sub
End If
If Not Testtxt(Text4.Text) Then
MsgBox "密碼不能為空!"
Text2.SetFocus
Exit Sub
End If
If Not Testtxt(Text5.Text) Then
MsgBox "兩次密碼輸入不一致!"
Text3.SetFocus
Exit Sub
End If
myrs.Fields(0) = Text3.Text
myrs.Fields(1) = Text4.Text
myrs.Fields(2) = power
myrs.Update
Set DataGrid1.DataSource = myrs
MsgBox "添加用戶信息成功!", vbInformation
End Sub
Private Sub command1_click()
'修改密碼
Dim myrs As New ADODB.Recordset
myrs.Open "SELECT * FROM pwd", con, adOpenDynamic, adLockOptimistic, adCmdText
If Text1.Text = "" Then
MsgBox "密碼不能為空!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
End If
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "兩次輸入密碼不一樣,請確認(rèn)!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Else
myrs.Fields(1) = Text2.Text
myrs.Update
Set DataGrid1.DataSource = myrs
MsgBox "密碼修改成功!", vbOKOnly + vbExclamation, "修改密碼"
End If
End Sub
Private Sub Command5_Click()
'退出
Unload Me
End Sub
Private Sub Command6_Click()
'退出
Unload Me
End Sub
Private Sub Form_Load()
'創(chuàng)建連接,并打開
Set con = New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\050531123賈晨微\db1.mdb;Persist Security Info=False"
con.Open
End Sub
Private Sub Command2_Click()
'取消
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -