【发布时间】:2018-01-22 04:42:57
【问题描述】:
如何只取一个SQL数组?我永远看不到带有“noOfColumns3”的行。 SQL 正在运行。
Function getSubmittalNotes(submitId)
Dim note_list, note_conn
Dim test
Set note_conn = Server.CreateObject("ADODB.Connection")
note_conn.Open Application("DSN")
Set note_list = Server.CreateObject("ADODB.Recordset")
note_list.CursorLocation = 3
note_list.Open "SELECT [ID], [SubmitID], [UserID], [EnteredTime], [Note] FROM [dbo].[SubmittalNotesHistory] where [SubmitID] = " & submitId, note_conn, 1, 3
'set notes = note_list.GetRows
If note_list.RecordCount = 0 Then
test = ""
Response.Write "noOfColumns123 : <BR>"
Else
note_list.MoveFirst
test = note_list.GetRows
Response.Write "noOfColumns3 : " & test & "<BR>"
End If
note_list.Close
Set note_list = Nothing
note_conn.Close
Set note_conn = Nothing
Response.Write "getSubmittalNotes : " & test & " <BR>"
getSubmittalNotes = test
End Function
【问题讨论】:
-
您应该使用
.Executemethod 从连接中获取记录集。
标签: sql vbscript asp-classic ado