Private Sub Command1_Click()Dim User_sql As String
If Text1.Text <> Empty And Text2.Text <> Empty And Text3.Text <> Empty And Text4.Text <> Empty Then
Set bookdata = OpenDatabase(App.Path + "\97.mdb", False, False)
User_sql = "select * from 人员登录信息表 where 员工工号='" + Text1.Text + "'and 密码='" + Text2.Text + "'"
Set rs1 = bookdata.OpenRecordset(User_sql, dbOpenDynaset) If Text3.Text = Text4.Text Then
If rs1.RecordCount > 0 Then
rs1.Edit
rs1!密码 = Text3.Text
rs1.Update
MsgBox ("恭喜您,您的密码修改成功!请记住您的新密码:" & Text3.Text), vbOKOnly, "系统提示!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
Else
MsgBox "帐号或密码不正确,请确认后重新输入!", vbOKOnly, "系统提示!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End If
Else
MsgBox "新密码两次输入不一致,请重新修改!", vbOKOnly, "系统提示!"
Text3.Text = ""
Text4.Text = ""
Text3.SetFocus
End If
Else
MsgBox "以上是必须填写完整的,请填写完整!", vbOKOnly, "系统提示!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End If
End Sub
标准表达式中数据类型不匹配,rs1=空值,求教如何修改?谢谢!
If Text1.Text <> Empty And Text2.Text <> Empty And Text3.Text <> Empty And Text4.Text <> Empty Then
Set bookdata = OpenDatabase(App.Path + "\97.mdb", False, False)
User_sql = "select * from 人员登录信息表 where 员工工号='" + Text1.Text + "'and 密码='" + Text2.Text + "'"
Set rs1 = bookdata.OpenRecordset(User_sql, dbOpenDynaset) If Text3.Text = Text4.Text Then
If rs1.RecordCount > 0 Then
rs1.Edit
rs1!密码 = Text3.Text
rs1.Update
MsgBox ("恭喜您,您的密码修改成功!请记住您的新密码:" & Text3.Text), vbOKOnly, "系统提示!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
Else
MsgBox "帐号或密码不正确,请确认后重新输入!", vbOKOnly, "系统提示!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End If
Else
MsgBox "新密码两次输入不一致,请重新修改!", vbOKOnly, "系统提示!"
Text3.Text = ""
Text4.Text = ""
Text3.SetFocus
End If
Else
MsgBox "以上是必须填写完整的,请填写完整!", vbOKOnly, "系统提示!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End If
End Sub
标准表达式中数据类型不匹配,rs1=空值,求教如何修改?谢谢!
http://download.csdn.net/detail/veron_04/3827200