?? form16.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form12
BorderStyle = 1 'Fixed Single
Caption = "修改密碼"
ClientHeight = 5310
ClientLeft = 45
ClientTop = 330
ClientWidth = 7335
LinkTopic = "Form12"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5310
ScaleWidth = 7335
Begin VB.CommandButton Command2
Caption = "退出"
Height = 975
Left = 4080
TabIndex = 5
Top = 3600
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "確認(rèn)"
Height = 975
Left = 840
TabIndex = 4
Top = 3600
Width = 1575
End
Begin VB.TextBox Text2
Height = 855
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 3
Top = 1680
Width = 2415
End
Begin VB.TextBox Text1
Height = 735
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 2
Top = 720
Width = 2415
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "請(qǐng)確認(rèn)密碼:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 360
TabIndex = 1
Top = 1920
Width = 2295
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "請(qǐng)輸入新密碼:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 0
Top = 840
Width = 2415
End
Begin VB.Image Image1
Height = 5295
Left = -120
Picture = "Form16.frx":0000
Stretch = -1 'True
Top = 0
Width = 7455
End
End
Attribute VB_Name = "Form12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim mrc As New ADODB.Recordset
Private Sub Command1_Click()
Dim txtsql As String
txtsql = "select * from 用戶表 where 用戶表.用戶名= " & "'" & Form1.use & "'"
Set mrc = executesql(txtsql)
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "兩次輸入密碼不一樣 請(qǐng)確認(rèn)!", , "警告"
Exit Sub
Else
If Text2.Text = "" Then
MsgBox "密碼不能為空!", vbExclamation, "警告"
Else
mrc.Fields(1).Value = Trim(Text1.Text)
mrc.Update
MsgBox "修改密碼成功!", , "修改密碼"
Me.Hide
End If
End If
End Sub
Public Function executesql(ByVal sql As String) As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Dim stokens() As String
stokens = Split(sql)
cnn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\student.mdb"
If InStr(" INSERT,DELETE,UPDATE", UCase$(stokens(0))) Then
cnn.Execute sql
Else
Set rst = New ADODB.Recordset
rst.Open Trim$(sql), cnn, adOpenKeyset, adLockOptimistic
Set executesql = rst
End If
End Function
Private Sub Command2_Click()
Me.Enabled = False
Me.Hide
End Sub
Private Sub Form_Load()
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\student.mdb"
conn.Open connstr
Text1.Text = ""
Text2.Text = ""
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -