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

📄 common.vb

📁 这是一个完善的图书馆管理系统.后台数据库采用ACCESS.
💻 VB
字号:
Imports Library.OleDatabase

Module Common
    Public OleConn As New OleDatabase
    Public UserName As String
    Public Password As String
    Public bookDataSet As New DataSet
    Public readerDataSet As New DataSet

    Public Function OutputAsExcel(ByRef ds As DataSet) As Boolean
        Dim app As Excel.Application
        Try
            app = CreateObject("Excel.Application")
            app.Visible = True
            Dim wb As Excel.Workbook
            wb = app.Workbooks.Add
            Dim ws As Excel.Worksheet
            Dim i, j As Integer
            Dim tmp As String
            ws = wb.Worksheets(1)
            ws.Activate()
            For i = 0 To ds.Tables(0).Rows.Count - 1
                For j = 0 To ds.Tables(0).Columns.Count - 1
                    tmp = ChrW(65 + j) & CStr(i + 1)
                    ws.Range(tmp).Select()
                    If Not ds.Tables(0).Rows(i).IsNull(j) Then
                        ws.Range(tmp).Value = CStr(ds.Tables(0).Rows(i).Item(j))
                    End If
                Next
            Next
        Catch ex As Exception
            OutputAsExcel = False
            OleConn.DisplayError(ex)
        End Try
        OutputAsExcel = True
    End Function
End Module

⌨️ 快捷键说明

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