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

📄 bb.cls

📁 这个就不用多说了
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Bb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim mycommand As New ADODB.Command
Dim myreder As New ADODB.Recordset
Function AddDataComboBox(ByVal strSql As String, ByVal myComboBox As ComboBox)
        sqlconn_open
        mycommand.ActiveConnection = sqlconn
        mycommand.CommandType = adCmdText
        mycommand.CommandText = strSql
        Set myreder = mycommand.Execute
        While Not myreder.EOF()
        If myreder.Fields.Count >= 2 Then
           myComboBox.AddItem (myreder.Fields(0).Value & "-" & myreder.Fields(1).Value)
        Else
           myComboBox.AddItem (myreder.Fields(0).Value)
        End If
           myreder.MoveNext
        Wend
           sqlconn.Close
    End Function
 Function AddGrid(ByVal strSql As String, ByVal mygrid As MSHFlexGrid)
         mygrid.clear
         sqlconn_open
         mycommand.ActiveConnection = sqlconn
         mycommand.CommandType = adCmdText
         mycommand.CommandText = strSql
         Set myreder = mycommand.Execute
         mygrid.Cols = myreder.Fields.Count
         mygrid.Row = 0
         For i = 0 To myreder.Fields.Count - 1
            mygrid.col = i
            mygrid.Text = myreder.Fields(i).Name
         Next
         Dim k As Integer
         k = 1
        While Not myreder.EOF()
              If mygrid.Rows - 1 < k Then
                   mygrid.Rows = mygrid.Rows + 1
              End If
              mygrid.Row = mygrid.Rows - 1
             For i = 0 To myreder.Fields.Count - 1
                  If Not IsNull(myreder.Fields(i).Value) Then
                     mygrid.col = i
                     
                     mygrid.CellAlignment = 0
                    mygrid.Text = myreder.Fields(i).Value
                  'Dim dubcol As Double
                  'Dim str As String
                
                   'dubcol = myreder.Fields(i).ActualSize
                   'If mygrid.ColWidth(i) <= dubcol Then
                   'mygrid.ColWidth(i) = dubcol
                   'End If
                 End If
            Next
                myreder.MoveNext
             k = k + 1
                Wend
                sqlconn.Close
    End Function
Function Hj(ByVal strSql As String, ByVal mygrid As MSHFlexGrid)
         sqlconn_open
         mycommand.ActiveConnection = sqlconn
         mycommand.CommandType = adCmdText
         mycommand.CommandText = strSql
         Set myreder = mycommand.Execute
          mygrid.Rows = mygrid.Rows + 1
          mygrid.Row = mygrid.Rows - 1
         mygrid.col = 3
         mygrid.Text = "合计:"
       
         mygrid.col = 4
         mygrid.CellAlignment = 0
        If Not IsNull(myreder.Fields(0).Value) Then
           mygrid.Text = myreder.Fields(0).Value
         Else
         mygrid.Text = 0
        End If
        sqlconn.Close
    End Function

⌨️ 快捷键说明

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