为什么不能修改密码?
做简单学生管理系统中,在修改密码中出了问题,为什么不能实现?
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim SQL As String
Dim DB As String
DB = App.Path & "\students.mdb"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB
SQL = "select * from 登录表 where 密码='" & login.password.Text & "'"
rs.Open SQL, conn, adOpenStatic, adLockOptimistic
If rs.RecordCount > 0 Then
If Text1.Text = Text2.Text Then
rs!密码 = Text1.Text
rs.Update
Else
MsgBox "修改密码和确认密码不一致!"
Text1.Text = ""
Text2.Text = ""
End If
End If
End Sub
//login.password.text是登录窗口的文本