access密码修改代码
发布网友
发布时间:2022-05-18 20:25
我来回答
共3个回答
热心网友
时间:2023-10-31 04:44
If IsNull(Me![user]) = True Then
MsgBox "请选择要修改密码的用户!", 64, "系统提示"
Me![user].SetFocus
Else
If IsNull(Me![pwd]) = True Then
MsgBox "原密码不可以为空,请重新输入!", 64, "系统提示"
Me![pwd].SetFocus
Else
If IsNull(Me![newpwd1]) = True Then
MsgBox "密码不可以为空,请重新输入!", 64, "系统提示"
Me![newpwd1].SetFocus
Else
If IsNull(Me![newpwd2]) = True Then
MsgBox "密码不可以为空,请重新输入!", 64, "系统提示"
Me![newpwd2].SetFocus
Else
If Me![newpwd1] <> Me![newpwd2] Then
MsgBox "新密码俩次输入不一致,请确认后重新输入!", 64, "系统提示"
Me![newpwd2] = ""
Me![newpwd1] = ""
Me![newpwd1].SetFocus
Else
If IsNull(DLookup("姓名", "tb用户资料", "姓名='" & Me![user] & "' and 密码='" & Me![pwd] & "'")) = True Then
MsgBox "原密码不对,请重新输入!", 64, "系统提示"
Me![pwd] = ""
Me![pwd].SetFocus
Else
Dim i As Integer
Dim stemp As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
stemp = "select * from tb用户资料 where 姓名='" & Me![user] & "'"
rs.Open stemp, CurrentProject.Connection, adOpenKeyset, adLockBatchOptimistic
rs("密码") = Me![newpwd1]
rs.UpdateBatch
MsgBox "密码修改成功,请记住新密码", 64, "系统提示"
DoCmd.Close acForm, "修改密码"
热心网友
时间:2023-10-31 04:44
on; //数据库连接对象
java.sql.Statement sqlStmt; //SQL语句对象
java.sql.ResultSet sqlRst; //结果集对象
java.lang.String strCon; //数据库连接字符串
//装载JDBC驱动程序
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//设置数据库连接字符串
strCon = "jdbc:odbc:key";
//连接数据库
sqlCon = java.sql.DriverManager.getConnection(strCon, "", "");
//创建一个可以滚动的只读的SQL语句对象
sqlStmt = sqlCon.createStatement();//准备SQL语句
strSQL = "UPDATE user SET 密码 = 新值 WHERE 用户名 = 某值";
//执行SQL语句跟新数据库
sqlStmt.executeUpdate(strSQL);
sqlStmt.close();
sqlCon.close();
热心网友
时间:2023-10-31 04:45
SqlStr = "update 数据表名 set pwd(数据库中的密码字段)='" + this.password(新密码框ID).Text + "' where ID=" + ID + "";