form5.frm
来自「VB 和 SQL相结合的。图书查询管理软件」· FRM 代码 · 共 261 行
FRM
261 行
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Begin VB.Form Form5
BackColor = &H008080FF&
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 8400
ClientLeft = 45
ClientTop = 435
ClientWidth = 12870
ForeColor = &H008080FF&
Icon = "Form5.frx":0000
LinkTopic = "Form5"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 8400
ScaleWidth = 12870
Begin VB.Timer Timer1
Interval = 100
Left = 10920
Top = 840
End
Begin ComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 615
Left = 0
TabIndex = 6
Top = 7785
Width = 12870
_ExtentX = 22701
_ExtentY = 1085
SimpleText = ""
_Version = 327682
BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
NumPanels = 3
BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
AutoSize = 1
Object.Width = 7514
Text = "修改密码"
TextSave = "修改密码"
Key = ""
Object.Tag = ""
EndProperty
BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Style = 5
AutoSize = 1
Object.Width = 7514
TextSave = "12:11"
Key = ""
Object.Tag = ""
EndProperty
BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7}
Style = 6
AutoSize = 1
Object.Width = 7514
TextSave = "2007-7-8"
Key = ""
Object.Tag = ""
EndProperty
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.CommandButton Command2
BackColor = &H00FFFF00&
Caption = "取消"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 6840
Style = 1 'Graphical
TabIndex = 5
Top = 6720
Width = 2175
End
Begin VB.CommandButton Command1
BackColor = &H00FFFF00&
Caption = "确定"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 3240
Style = 1 'Graphical
TabIndex = 4
Top = 6720
Width = 2295
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
IMEMode = 3 'DISABLE
Left = 3720
PasswordChar = "*"
TabIndex = 3
Top = 4320
Width = 4575
End
Begin VB.TextBox Text1
Height = 735
IMEMode = 3 'DISABLE
Left = 3720
PasswordChar = "*"
TabIndex = 2
Top = 2040
Width = 4575
End
Begin VB.Image Image1
Height = 3465
Left = 9120
Picture = "Form5.frx":0B3A
Stretch = -1 'True
Top = 1800
Width = 3360
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "欢 迎 修 改 密 码"
BeginProperty Font
Name = "隶书"
Size = 36
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF00&
Height = 855
Left = 2280
TabIndex = 7
Top = 480
Width = 8535
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "确认密码"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 1
Top = 4440
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "新密码"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 0
Top = 2280
Width = 1815
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
If Text1.Text <> Text2.Text Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Else
sql = "select * from 系统管理表"
cn.Open "Driver={SQL Server};Server=.;Database=bookmdb;Uid=sa;Pwd=" '连接SQL数据库
rs.Open "系统管理表", cn, adOpenKeyset, adLockOptimistic
rs.Fields(1) = Text1.Text
rs.Fields(0) = userID
rs.Fields(2) = userpow
rs.Update
rs.Close
MsgBox "密码修改成功", vbOKOnly + vbExclamation, "" '弹出对话框说明修改密码成功
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
'Form5.Hide
End Sub
Private Sub Timer1_Timer()
Static direction As Integer
If Label3.Left < 0 Then direction = 0
If Label3.Left + Label3.Width > Form5.Width Then
direction = 1
End If
If direction = 1 Then
Label3.Left = Label3.Left - 100
End If
If direction = 0 Then
Label3.Left = Label3.Left + 100
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?