毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

VB+SQL书店图书管理系统(任务书+开题报告+论文) 第9页

更新时间:2010-5-3:  来源:毕业论文
VB+SQL书店图书管理系统(任务书+开题报告+论文) 第9页
全局变量定义:
'用户身份标志
Public UserShenFen As String
'登陆状态
Public logOK As Boolean
'用户名
Public userName As String
'供应商编号
Public GongYingShangID As String
'供应商
Public GongYingShang As String
'图书编号
Public TuShuBianHao As String
'定价
Public DingJia As String
'书名
Public ShuMing As String
'会员卡号
Public HuiYuanKaHao As String
'会员姓名
Public HYXingMing As String
'会员等级
Public HYDengJi As String
模块名:CheckUser
原型:Public Sub CheckUser(userID As String, passwd As String)
代码:
Public Sub CheckUser(userID As String, passwd As String)

Dim userDB As Database
Dim userRD As Recordset
Dim dbName As String
Dim STRSQL As String

Screen.MousePointer = 11

On Error GoTo errEnd

dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
STRSQL = "select [用户身份] from [Admin] where [用户ID]=""" & userID & """ and [用户密码]=""" & passwd & """"

'打开数据库
Set userDB = DBEngine.Workspaces(0).OpenDatabase(dbName, False, True)
'检索用户,验证密码
Set userRD = userDB.OpenRecordset(STRSQL, dbOpenSnapshot)

If userRD.RecordCount > 0 Then
    '设置用户身份
    UserShenFen = userRD![用户身份]
    '关闭数据库
    userRD.Close
    Set userRD = Nothing
    userDB.Close
    Set userDB = Nothing
   
    '进入用户环境
    Load FrmMain
    FrmMain.Show
    Unload FrmLogIn
    logOK = True
    userName = userID
    Screen.MousePointer = vbDefault
Else
    '关闭数据库
    userRD.Close
    Set userRD = Nothing
    userDB.Close
    Set userDB = Nothing
    logOK = False
   
    Screen.MousePointer = vbDefault
    MsgBox "用户名或密码错误!请重新输入!", vbOKOnly + vbExclamation, "登陆失败"
End If
Exit Sub

errEnd:
    Screen.MousePointer = vbDefault
    MsgBox Err.Description, vbOKOnly + vbExclamation, "登陆错误"
    logOK = False
    Err.Clear
    '关闭数据库
    userRD.Close
    Set userRD = Nothing
    userDB.Close
    Set userDB = Nothing
    Exit Sub

End Sub

模块名:LogOff
模块原型:Public Sub LogOff()
代码:
Public Sub LogOff()
Dim retVal As Integer
retVal = MsgBox("你确定要注销吗?", vbOKCancel + vbQuestion, "注销当前用户")
If retVal = vbCancel Then Exit Sub
Load FrmLogIn
FrmLogIn.Show
If UserShenFen = "经理" Then
    Unload FrmAdminMain
ElseIf UserShenFen = "仓库管理员" Then
    Unload FrmCangGuanMain
ElseIf UserShenFen = "售书员" Then
    Unload FrmBookSellerMain
ElseIf UserShenFen = "会员" Then
    Unload FrmMemberMain
Else
    Unload FrmGuestMain
End If
Unload FrmMain
UserShenFen = ""

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

VB+SQL书店图书管理系统(任务书+开题报告+论文) 第9页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。