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

VB+SQL书店图书管理系统(任务书+开题报告+论文) 第10页
模块名:Sys_exit
模块原型:Public Sub Sys_exit()
代码:
Public Sub Sys_exit()

Dim retVal As Integer

retVal = MsgBox("你确定要退出吗?", vbOKCancel + vbQuestion, "退出系统")
If retVal = vbCancel Then Exit Sub

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
End

End Sub

模块名:Form_Load
模块原型:Private Sub Form_Load()
代码:
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String

On Error GoTo errEnd

ChDir App.Path
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"

connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR

Exit Sub

errEnd:
    MsgBox "连接数据库失败!", vbOKOnly + vbExclamation, "打开数据库出错"
    End

End Sub

模块名:GetHYDaZhe
模块原型:Public Function GetHYDaZhe(bianHao As String) As String
代码:
Public Function GetHYDaZhe(bianHao As String) As String
On Error GoTo errEnd

If bianHao = "☆☆☆☆☆" Then
    GetHYDaZhe = "1"
    Exit Function
End If

Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select [打折] from [会员政策] where [会员级别]=""" & bianHao & """"
Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.MoveFirst
    GetHYDaZhe = Adodc1.Recordset!打折
Else
    MsgBox "会员政策数据丢失,请与经理联系!", vbOKOnly + vbExclamation, "检索错误"
    GetHYDaZhe = "1"
End If

Exit Function
errEnd:
    MsgBox "检索数据库出错!", vbOKOnly + vbExclamation, "检索错误"
    GetDingJia = "未知"
End Function

模块名:GetKuCun
模块原型:Public Function GetKuCun(bianHao As String) As String
代码:
Public Function GetKuCun(bianHao As String) As String
On Error GoTo errEnd

Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select [库存量] from [Book] where [图书编号]=""" & bianHao & """"
Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.MoveFirst
    GetKuCun = Adodc1.Recordset!库存量
Else
    MsgBox "图书资料数据丢失,请与经理联系!", vbOKOnly + vbExclamation, "检索错误"
    GetKuCun = "0"
End If

Exit Function
errEnd:
    MsgBox "检索数据库出错!", vbOKOnly + vbExclamation, "检索错误"
    GetDingJia = "未知"
End Function

模块名:HYShengJi
模块原型:Public Function HYShengJi(HYKaHao As String) As Boolean
代码:
Public Function HYShengJi(HYKaHao As String) As Boolean
On Error GoTo errEnd
Dim BiaoZhun As Integer
Dim SUMBook As Integer

If HYKaHao = "Guest" Then
    HYShengJi = False
    Exit Function

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

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有