设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12下一页
返回列表 发新帖
查看: 1873|回复: 11
打印 上一主题 下一主题

[Access本身] [求助]请教登陆界面密码

[复制链接]
跳转到指定楼层
1#
发表于 2006-11-12 22:00:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请教如下登陆界面的密码是什么,一下是事件代码。
Private Sub img0a1_Click()
On Error GoTo Err_img0a1_Click
   
    If 组合2 = "" Or IsNull(Me.组合2) Then
        MsgBox "请选择用户名!", vbOKOnly + vbInformation, "提示"
        组合2.SetFocus
    ElseIf 密码 = DLookup("[密码]", "用户密码表", "[用户名]= " & "'" & Me.组合2 & "'") Then
        user = Me.组合2
        userlx = 组合2.Column(2)
        re = 0
        DoCmd.Close acForm, "登录"
        DoCmd.OpenForm "操作窗口"
    Else
        re = re + 1
        MsgBox "您输入的密码不正确,请重新输入!", vbOKOnly + vbExclamation, "错误"
        密码.SetFocus
        If re > 2 Then
            MsgBox "由于您三次输入的密码都不正确,系统将自动关闭!", vbOKOnly + vbCritical, "密码不正确"
            DoCmd.Quit
        End If
    End If
Exit_img0a1_Click:
    Exit Sub

Err_img0a1_Click:
    MsgBox Err.Description
    Resume Exit_img0a1_Click
End Sub

Private Sub img0a_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.img0a.Visible = False
Me.img0a1.Visible = True
End Sub

Private Sub Cmd取消_Click()
    On Error GoTo Err_Cmd取消_Click

    DoCmd.Close
    DoCmd.Quit

Exit_Cmd取消_Click:
    Exit Sub

Err_Cmd取消_Click:
    MsgBox Err.Description
    Resume Exit_Cmd取消_Click

End Sub


Private Sub cmqd_Click()
On Error GoTo Err_cmqd_Click


      If 组合2 = "" Or IsNull(Me.组合2) Then
        MsgBox "请选择用户名!", vbOKOnly + vbInformation, "提示"
        组合2.SetFocus
    ElseIf 密码 = DLookup("[密码]", "用户密码表", "[用户名]= " & "'" & Me.组合2 & "'") Then
        user = Me.组合2
        userlx = 组合2.Column(2)
        re = 0
        DoCmd.Close acForm, "登录"
        DoCmd.OpenForm "操作窗口"
    Else
       re = re + 1
        MsgBox "您输入的密码不正确,请重新输入!", vbOKOnly + vbExclamation, "错误"
        密码.SetFocus
        If re > 2 Then
            MsgBox "由于您三次输入的密码都不正确,系统将自动关闭!", vbOKOnly + vbCritical, "密码不正确"
            DoCmd.Quit
        End If
    End If
Exit_cmqd_Click:
    Exit Sub

Err_cmqd_Click:
    MsgBox Err.Description
    Resume Exit_cmqd_Click
End Sub

Private Sub Form_Load()
   DoCmd.Maximize
   ImgTop.Width = Me.WindowWidth
   ImgBot.Width = Me.WindowWidth
   log.Left = Me.WindowWidth / 2 - log.Width - 200
   log.Top = Me.WindowHeight / 2 - log.Height
   ImgPic.Top = Me.WindowHeight / 2 - log.Height / 2 + 1000
   ImgPic.Left = Me.WindowWidth / 2 + 100
   ImgLine.Left = Me.WindowWidth / 2 - 300
   bq1.Left = Me.WindowWidth / 2 + 1000
   Me.组合2.Left = Me.WindowWidth / 2 + 1280
   Me.组合2.Top = Me.WindowHeight / 2 - log.Height / 2 + 100
   Me.img04.Left = Me.WindowWidth / 2 + Me.组合2.Width + 1000
   Me.img04.Top = Me.WindowHeight / 2 - log.Height / 2 + 100
   Me.yhb.Left = Me.WindowWidth / 2 + 1430
   Me.yhb.Top = Me.WindowHeight / 2 - log.Height / 2 + 100
   Me.密码.Left = Me.WindowWidth / 2 + 1280
   Me.密码.Top = Me.WindowHeight / 2 - log.Height / 2 + 680
   Me.img0a.Top = Me.WindowHeight / 2 - log.Height / 2 + 680
   Me.img0a.Left = Me.WindowWidth / 2 + Me.密码.Width + 1480
   Me.img0a1.Top = Me.WindowHeight / 2 - log.Height / 2 + 680
   Me.img0a1.Left = Me.WindowWidth / 2 + Me.密码.Width + 1480
   Me.mmb.Left = Me.WindowWidth / 2 + 1430
   Me.mmb.Top = Me.WindowHeight / 2 - log.Height / 2 + 680
  
End Sub

Private Sub img0b1_Click()
DoCmd.Close
DoCmd.Quit
End Sub

Private Sub img0b_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.img0b1.Visible = True
Me.img0b.Visible = False
End Sub

Private Sub 窗体页脚_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.img0b.Visible = True
Me.img0b1.Visible = False
End Sub

Private Sub 主
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2006-11-12 22:21:00 | 只看该作者
这里并没有给出具体的密码,密码是放在"用户密码表"中,跟用户相对应
3#
 楼主| 发表于 2006-11-12 22:45:00 | 只看该作者
新建一用户密码表保存时提示和用户密码表重名,但在表中找不到用户密码表,请指教。
4#
发表于 2006-11-12 23:24:00 | 只看该作者
看看之前所建的用户密码表是不是给隐藏了??
5#
 楼主| 发表于 2006-11-12 23:33:00 | 只看该作者
请教怎样显示隐藏的表。
6#
发表于 2006-11-12 23:42:00 | 只看该作者
工具—选项—把在视图栏中的隐藏对象钩选再点确认。

7#
 楼主| 发表于 2006-11-13 16:16:00 | 只看该作者
谢谢指教.
8#
发表于 2006-11-13 19:02:00 | 只看该作者
"[用户名]= " & "'" & Me.组合2 & "'")

组合框一般绑定到数字,写成"用户ID=" & Me.组合2
9#
 楼主| 发表于 2006-11-13 20:23:00 | 只看该作者
请教“Me.组合2”的Me.应怎样解释。
10#
发表于 2006-11-14 00:08:00 | 只看该作者
本窗体
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-31 19:01 , Processed in 0.088176 second(s), 33 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表