Dim conn As New ADODB.Connection
Dim rchang As New ADODB.Recordset
Private Sub Command1_Click()
If rchang.RecordCount > 0 Then'判断一下记录集就好了
If Text2.Text <> rchang.Fields("密码") Then
MsgBox ("原密码输入错误")
ElseIf Text3.Text <> Text4.Text Then
MsgBox ("新密码不一致")
Else
rchang.Fields("密码") = Text3.Text——————这里变成黄色
MsgBox ("密码修改成功!")
rchang.Update
End If
End If
End Sub
Private Sub Command2_Click()
conn.Close
frmchangpwd.Hide
End Sub
Private Sub Form_Load()
Set conn = New ADODB.Connection
conn.Open "driver=microsoft access driver (*.mdb);dbq=" & App.Path & "\图书管理信息系统.mdb"
rchang.Open "select * from 用户登录信息表 where 用户名='" & num & "'", conn, adOpenDynamic, adLockOptimistic
End Sub