⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moddatabase.bas

📁 图书管理系统!有源代码!论文!心得!
💻 BAS
字号:
Attribute VB_Name = "modDatabase"



Option Explicit
    
'Public totBooks As String
Public fineAmt As String
Public maxDays As String

Public cn As Connection
Public rsUser As Recordset 'Recordset for users
Public rsPubId As New Recordset
Public rsCatId As New Recordset
Public rsClassId As New Recordset
Public rsLibraryId As New Recordset
Public rsBookId As New Recordset


Public rsBookInfo As New Recordset
Public rsPubInfo As New Recordset
Public rsCatInfo As New Recordset
Public rsClassInfo As New Recordset
Public rsUserInfo As New Recordset
Public rsMemberInfo As New Recordset
Public rsIssueInfo As New Recordset
Dim conf As Integer

Public Sub main()

    frmSplash.Show
    DoEvents 'it allows splash screen to display

    If conf = 0 Then
    Set cn = New Connection
    cn.ConnectionString = "provider=Microsoft.Jet.OLEDB.3.51;data source=" & App.Path & "\library.mdb;"
    cn.CursorLocation = adUseClient
    cn.Open
    
    If cn.State = adStateOpen Then
        'when no database connection error occurs
        Set rsUser = New Recordset
        rsUser.CursorLocation = adUseClient
        rsUser.Open "Select user_id from user", cn, adOpenKeyset, adLockPessimistic
        rsBookInfo.Open "select * from bookinfo", cn, adOpenKeyset, adLockPessimistic
        rsPubId.Open "select publication_id from publication", cn, adOpenKeyset, adLockPessimistic
        rsCatId.Open "select catid from cat", cn, adOpenKeyset, adLockPessimistic
        rsClassId.Open "select Class_id from class", cn, adOpenKeyset, adLockPessimistic
        rsLibraryId.Open "select Library_id from student", cn, adOpenKeyset, adLockPessimistic
        rsBookId.Open "select book_id from bookInfo", cn, adOpenKeyset, adLockPessimistic
        rsPubInfo.Open "select * from publication", cn, adOpenKeyset, adLockPessimistic
        rsCatInfo.Open "select * from cat", cn, adOpenKeyset, adLockPessimistic
        rsClassInfo.Open "select * from class", cn, adOpenKeyset, adLockPessimistic
        rsUserInfo.Open "select * from user", cn, adOpenKeyset, adLockPessimistic
        rsMemberInfo.Open "select * from student", cn, adOpenKeyset, adLockPessimistic
        rsIssueInfo.Open "select * from Issue", cn, adOpenKeyset, adLockPessimistic
        frmLogin.Show
        
        Unload frmSplash
    Else
        'when database connection error occurs
        MsgBox "数据库连接错误!!", vbCritical, "图书馆信息管理系统"
        End
    End If
    conf = 1
    Else
    Unload frmSplash
    frmLogin.Show
    End If
End Sub






⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -