m*******n 发帖数: 370 | 1 请高人帮我看看,同样的一段code,如果database连Access, rsArray里可以正常写入所有的
fields,但是如果连SQL server就只能写入NomID和Categories.Description,其他都为
空.我把strQ对应的select语句放到SQl server里去run,结果也是对的,每个field都显示
了,但为什么没有能够被读到里rsArray呢? rsArray = objRS.GetRows()为什么没能读
全?
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS.ActiveConnection = Connection
strQ = "SELECT NominationDetailsCurrent.NomID, Title, OrderNo, Letter,
CategoryName, Categories.Description, Categories.Weight " & _
"FROM (NominationDetailsCurrent LEFT JOIN NominationCategories
ON NominationCategories.NomID = NominationDetailsCurrent.NomID) LEFT
JOIN Categories ON NominationCategories.CategoryID =
Categories.CategoryID " & _
"ORDER BY Categories.Weight, OrderNo "
Response.Write( " The strQ is: " & strQ & " ")
objRS.Open strQ
If Not objRS.EOF Then
rsArray = objRS.GetRows()
End If
For Each item In rsArray
Response.Write(item & " ")
Next |
|