Private Sub cmd1_Click()
Dim p As String
Dim p2 As String
dim conn As New ADODB.Connection
Dim rs2 As New ADODB.Recordset
conn.open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=yj"
Dim sql As String
rs2.Open "select * from 用户 order by id", conn, adOpenKeyset, adLockOptimistic
p = InputBox("请输入新密码")
p2 = InputBox("请再次输入新密码")
If p <> p2 Or p = "" Then
MsgBox "输入有误"
Exit Sub
End If
rs2.close
sql = "update 用户 set 密码='" & p & "' where 用户名='" & UserName & "'"
conn.Execute sql
End Sub
Dim p As String
Dim p2 As String
dim conn As New ADODB.Connection
Dim rs2 As New ADODB.Recordset
conn.open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=yj"
Dim sql As String
rs2.Open "select * from 用户 order by id", conn, adOpenKeyset, adLockOptimistic
p = InputBox("请输入新密码")
p2 = InputBox("请再次输入新密码")
If p <> p2 Or p = "" Then
MsgBox "输入有误"
Exit Sub
End If
rs2.close
sql = "update 用户 set 密码='" & p & "' where 用户名='" & UserName & "'"
conn.Execute sql
End Sub
我的msn: myfend@