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

📄 codemodeclass.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 = "CodeModeClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False

    Dim mycommand As New ADODB.Command
    Dim Myrecordset As New ADODB.Recordset

    Sub InitialData(ByVal strstate As String, ByVal textbox1 As TextBox, ByVal textbox2 As TextBox, ByVal textbox3 As TextBox, _
    ByVal textbox4 As TextBox)
        Dim strSql As String
        strSql = "select * from code where Name = " & "'" & strstate & "'"
        Call sqlconn_open
        mycommand.CommandType = adCmdText
        mycommand.CommandText = strSql
        mycommand.ActiveConnection = sqlconn
        Set Myrecordset = mycommand.Execute()
        textbox1.Text = Myrecordset.Fields(1).Value
        textbox2.Text = Myrecordset.Fields(2).Value
        textbox3.Text = Myrecordset.Fields(3).Value
        textbox4.Text = Myrecordset.Fields(4).Value
        sqlconn.Close
    End Sub
    Function UpData(ByVal strUpdate As String)
       Call sqlconn_open
        mycommand.CommandText = strUpdate
        mycommand.ActiveConnection = sqlconn
        mycommand.Execute (strSql)
        sqlconn.Close
    End Function
    Function PassTest(ByVal str1 As String, ByVal str2 As String, ByVal str3 As String, ByVal str4 As String) As Boolean
        PassTest = True
        If str1 = 0 And str2 <> 0 Then
            PassTest = False
        End If
        If str2 = 0 And str3 <> 0 Then
            PassTest = False
        End If
        If str3 = 0 And str4 <> 0 Then
            PassTest = False
        End If
    End Function
    Function EditFlag(ByVal strstate As String) As Boolean
         Dim strtable As String
        EditFlag = False
        If strstate = "Gyzc" Then
            strtable = "GyzcCode"
        End If
        If strstate = "DwBm" Then
            strtable = "DwBmCode"
        End If
        Dim strSql As String
        strSql = "select count(*) from " & strtable
        Call sqlconn_open
        mycommand.CommandText = strSql
        mycommand.ActiveConnection = sqlconn
        Set Myrecordset = mycommand.Execute()
        If Myrecordset.Fields(0).Value > 0 Then
        EditFlag = True
        End If
       sqlconn.Close
    End Function

⌨️ 快捷键说明

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