相关疑难解决方法(0)

从经典ASP中的函数返回记录集

我对如何从经典ASP中的函数返回可读记录集感到茫然.

这是我想出来的,但它不起作用:

Response.Clear
Response.CharSet = "utf-8"
Response.ContentType = "text/plain"

Dim Count

Set Count = Test

Response.Write Count.Fields(0).Value


Function Test

    Dim Query, Connection, Command, Recordset

    Query = " blah blah blah "

    Set Connection = Server.CreateObject("ADODB.Connection")
    Set Command = Server.CreateObject("ADODB.Command")
    Set Recordset = Server.CreateObject("ADODB.Recordset")

    Connection.ConnectionString = "blah blah blah"
    Connection.Open

    Set Command.ActiveConnection = Connection
    Command.CommandText = Query

    Set Recordset = Command.Execute

    Set Test = Recordset

    Recordset.Close
    Connection.Close

    Set Recordset = Nothing
    Set Command = Nothing
    Set Connection = Nothing

End Function …
Run Code Online (Sandbox Code Playgroud)

function adodb recordset asp-classic

5
推荐指数
1
解决办法
3万
查看次数

标签 统计

adodb ×1

asp-classic ×1

function ×1

recordset ×1