Dim sql As String = "update DLYZ set 登陆密码='" + TextBox_xgmm_xdmm.Text.Trim() + "'where 工作证号 ='" + Form1.TextBox1.Text.Trim() + "'"
创新互联建站服务项目包括泽州网站建设、泽州网站制作、泽州网页制作以及泽州网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,泽州网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到泽州省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
where前面需要加上空格
If Trim(ypsw.Text) = "" Then
MsgBox("原密码不能为空!", MsgBoxStyle.Critical)
ElseIf Trim(xpsw.Text) = "" Then
MsgBox("新密码不能为空!", MsgBoxStyle.Critical)
ElseIf Trim(qpsw.Text) Trim(xpsw.Text) Then
MsgBox("确认密码与新密码不一致!", MsgBoxStyle.Critical)
Else
Dim mycon As New OleDbConnection
mycon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" Application.StartupPath "\data\Datas.mdb"
mycon.Open()
Dim mycmd As New OleDbCommand
mycmd.CommandText = "select * from 管理员 where 用户名='admin' and 密码='" ypsw.Text " '"
mycmd.Connection = mycon
Dim myada As New OleDbDataAdapter
myada.SelectCommand = mycmd
Dim myda As New DataSet
myada.Fill(myda, "yh")
If myda.Tables("yh").Rows.Count 1 Then
MsgBox("您输入的原密码不正确,请重新输入!", MsgBoxStyle.Critical)
ypsw.Focus()
Else
mycmd.CommandText = "update 管理员 set 密码='" Trim(ypsw.Text) " '"
mycmd.ExecuteNonQuery()
MsgBox("密码修改成功!", MsgBoxStyle.Information)
End If
End If
以下这里有错误:
Dim mysqlstr As String = "SELECT * FROM 登录表 WHERE users='" username " 'AND password='" userpassword " '"
修改为:
Dim mysqlstr As String = "SELECT * FROM 登录表 WHERE users='" username "' AND password='" userpassword "'"