| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 509 人关注过本帖
标题:VB修改不了密码
只看楼主 加入收藏
windcloud1986
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-4-23
收藏
 问题点数:0 回复次数:1 
VB修改不了密码
帮我看看 急
Dim msg As String


Private Sub CmdCancel_Click()
    Inventory_management.Enabled = True
    Unload Me
End Sub

Private Sub Form_Load()
    Dim rst As ADODB.Recordset
    Dim strItem As String
    SQL = "select UserID,Username From User_information Order by UserID"
    Set rst = SelectSQL(SQL, msg)
    If rst.RecordCount > 0 Then
        Do While Not rst.EOF
            strItem = rst.Fields(0) & " " & rst.Fields(1)
            CboName.AddItem (strItem)
            rst.MoveNext
        Loop
        rst.Close
        CboName.ListIndex = 0
    Else
        MsgBox ("Please create user information")
        CmdOK.Enabled = False
        Exit Sub
    End If
End Sub

Private Sub CmdOK_Click()
    Dim rst As ADODB.Recordset
    Dim password As String
    Dim pOld As String
    Dim pNew As String
    Dim pCheck As String
    pOld = Trim(TextOld.Text)
    pNew = Trim(TextNew.Text)
    pCheck = Trim(TextCheck.Text)
    UserID = Left(Trim(CboName.Text), 4)
    SQL = "Select UserID,Username,Password from User_information where UserID ='" & UserID & "'"
    SQL = SQL & " AND Password='" & pOld & "'"
    On Error GoTo ErrMsg
    Set rst = SelectSQL(SQL, msg)
    If rst.RecordCount > 0 Then
        If (pCheck <> pNew) Then
            MsgBox ("Enter a password twice inconsistency")
            Exit Sub
        End If
        rst.Fields("Password") = pNew
        rst.Update
        MsgBox ("Update success")
     Else
        MsgBox ("Enter the old password error")
        Exit Sub
    End If
    Exit Sub
ErrMsg:
    MsgBox Err.Description, vbExclamation, "Error"
   
End Sub
搜索更多相关主题的帖子: 密码 
2008-05-06 12:10
oclassic
Rank: 1
等 级:新手上路
帖 子:140
专家分:0
注 册:2007-4-18
收藏
得分:0 
一上来就搞这么多代码.晕了. 说说要实现什么功能啊.

编程群号码30772309群刚刚建立一个论坛http://tszbbs./?u=2 诚招斑猪哦
2008-05-06 19:47
快速回复:VB修改不了密码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027534 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved