getinfo.cls

来自「客户管理crm xitong ,希望能给你带来帮助」· CLS 代码 · 共 49 行

CLS
49
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "GetInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Dim objConn As ADODB.Connection

Public Sub OnEndPage()
    Set server = Nothing
    Set session = Nothing
    Set application = Nothing
    Set request = Nothing
    Set response = Nothing
    disconnect objConn
End Sub ' OnEndPage

Public Sub OnStartPage(mysc As ScriptingContext)
    Set server = mysc.server
    Set application = mysc.application
    Set session = mysc.session
    Set request = mysc.request
    Set response = mysc.response
    
    Set objConn = server.CreateObject("ADODB.Connection")
    connect objConn
End Sub

Public Function getInfo() As String
    strR = ""
    strsql = "select * from " & request("strTable") & " where " & strfield & "=" & strFieldValue
    Set rs1 = server.CreateObject("adodb.recordset")
    rs1.Open strsql, objConn, 1, 1
    If Not rs1.EOF Then
        Do While Not rs1.EOF
            strR = strR & "<option value=" & rs1.Fields(strSValue) & ">" & rs1.Fields(strSField) & "</option>"
        rs1.MoveNext
        Loop
    End If
    getInfo = strR
End Function

⌨️ 快捷键说明

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