码迷,mamicode.com
首页 > 数据库 > 详细

access登录校验代码二

时间:2018-05-01 12:31:45      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:ocm   rds   name   dso   cmd   source   没有   user   get   

‘ 这一段是用来检查有没有输入用户名或密码的
If IsNull(Trim(Me.username )) Then
DoCmd.Beep
MsgBox ("请输入用户名称! ")
Else
If IsNull(Trim(Me.password )) Then
DoCmd.Beep
MsgBox ("请输入密码! ")
Else
‘ 以下是用来与[登陆表]做对比的
Me.RecordSource = "select * from 登陆表 where 用户名 = ‘" & Me.username & "‘ and 密码 =‘" & Me.password & "‘"
‘Set rs = GetRS(str)
If Me.Recordset.EOF Then
DoCmd.Beep
MsgBox ("没有这个用户或密码有误 , 请重新输入! ")
Me. username = ""
Me. password = ""
Me. username .SetFocus
Exit Sub
Else
DoCmd.Close
‘ 试用版使用次数的限制
If n = 50 Then
DoCmd.Close
Else
n = n + 1
MsgBox ("欢迎使用承德县干部管理系统! ")
check = True ‘ 设置登陆标志
DoCmd.OpenForm ("主查询窗体 ")
End If
End If
End If

access登录校验代码二

标签:ocm   rds   name   dso   cmd   source   没有   user   get   

原文地址:https://www.cnblogs.com/ince/p/8975760.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!