?? setpass.frm
字號:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SmartXPButton.ocx"
Begin VB.Form setpass
BackColor = &H00E7DFE7&
Caption = "修改密碼"
ClientHeight = 3780
ClientLeft = 60
ClientTop = 450
ClientWidth = 5580
Icon = "setpass.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3780
ScaleWidth = 5580
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 0
Top = 1320
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 1
Top = 2160
Width = 1575
End
Begin SmartXPButton.XpButton cmdcancel
Height = 495
Left = 3000
TabIndex = 2
Top = 3000
Width = 1815
_ExtentX = 3201
_ExtentY = 873
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "取消(&C)"
PictureSmoothBackColor= 15460844
ButtonPicture = "setpass.frx":0A02
End
Begin SmartXPButton.XpButton cmdok
Height = 495
Left = 720
TabIndex = 3
Top = 3000
Width = 1695
_ExtentX = 2990
_ExtentY = 873
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "確定(&O)"
PictureSmoothBackColor= 15460844
ButtonPicture = "setpass.frx":1414
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "確認密碼:"
Height = 255
Left = 2085
TabIndex = 6
Top = 2280
Width = 855
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "密碼設置"
BeginProperty Font
Name = "隸書"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000002&
Height = 495
Left = 1920
TabIndex = 5
Top = 120
Width = 2055
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "新密碼(&P):"
Height = 495
Left = 2040
TabIndex = 4
Top = 1440
Width = 975
End
Begin VB.Image Image1
Height = 1740
Left = 360
Picture = "setpass.frx":1E26
Top = 840
Width = 1380
End
End
Attribute VB_Name = "setpass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myconn As New ADODB.Connection
Dim str As String
Dim MyStr As String
Dim MyRs As New ADODB.Recordset
Private Sub cmdcancel_Click()
MyRs.Close
myconn.Close
Unload Me
End Sub
Private Sub cmdok_Click()
Dim varmark As Variant
If Len(Trim(Text1.Text)) > 10 Or Len(Trim(Text2.Text)) > 15 Then
MsgBox "密碼太長!", vbOKOnly + vbExclamation, "錯誤信息"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Exit Sub
End If
With MyRs
varmark = .Bookmark
.Find "username=" & Trim(dluser)
If .EOF Then
.Bookmark = varmark
Else
If Trim(Text1.Text) = Trim(Text2.Text) Then
.Fields("password") = Trim(Text1.Text)
If MsgBox("保存修改結果嗎?", vbYesNo) = vbYes Then
.Update
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
.CancelUpdate
End If
Else
MsgBox "兩次輸入的密碼不一致,請重新輸入密碼!", vbOKOnly + vbExclamation, "錯誤提示"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End If
End With
End Sub
Private Sub Form_Load()
Set myconn = New ADODB.Connection
myconn.ConnectionString = "driver={SQL Server};" & _
"server=(local);uid=sa;pwd=;database=student_info"
myconn.Open
'***** 使用Recordset對象的Open方法創建記錄集 *****
'MyRs.Open "manager", MyConn, adOpenStatic, adLockOptimistic, adCmdTable
Set MyRs = New ADODB.Recordset
With MyRs
.Source = "manager"
.ActiveConnection = myconn
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open , , , , adCmdTable
End With
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -