If you must have all of the TEXT columns, then I suggest yuo use bound
fields and use a recordset instead of GetRows in this instance. Adjust the
CacheSize of the recordset for best performance. Here is an example of
that:
rs.Open sql, conn, adOpenForwardOnly, adLockReadOnly, adCmdText
rs.CacheSize = 50 'adjust for best performance
Set fld0 = rs.Fields.Item(0)
Set fld1 = rs.Fields.Item(1)
Set fld2 = rs.Fields.Item(2)
Set fld3 = rs.Fields.Item(3)
Set fld4 = rs.Fields.Item(4)
Do While Not rs.EOF
' do stuff with values
buffer = fld.Value
rs.MoveNext
Loop
Set fld0 = Nothing
Set fld1 = Nothing
Set fld2 = Nothing
Set fld3 = Nothing
Set fld4 = Nothing
rs.Close
Set rs = Nothing
David L. Penton, Microsoft MVP
JCPenney Application Specialist / Lead
"Mathematics is music for the mind, and Music is Mathematics for the
Soul. - J.S. Bach"
[EMAIL PROTECTED]
Do you have the VBScript Docs or SQL BOL installed? If not, why not?
VBScript Docs: http://www.davidpenton.com/vbscript
SQL BOL: http://www.davidpenton.com/sqlbol
-----Original Message-----
From: Adrian Hoess [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 2:09 AM
To: ActiveServerPages
Subject: Problem with GetRows : Never encountered this one before
Hi all
This is a strange one ...
I have opened a recordset and placed it into a local array using the
getrows method.
i seem to have missing values in the array which are present in the
recordset. i loop through the rs, and print all the values out. no
problem.
i then call getrows and then loop through the array to print out the
variables, and some values are missing.
if i swap the fields around in the sql statement, additional elements in
the array dissappear, or reappear. i can never get all the values in the
recordset.
--------------------------
here is the code:
--------------------------
Set objRs = Server.CreateObject("adodb.recordset")
objRS.Open strSQL, strConn , adOpenForwardOnly, adLockReadOnly, adCmdText
if NOT (objRS.EOF) then
while NOT objRS.EOF
response.write objRS(0) & " : "
response.write objRS(1) & " : "
response.write objRS(2) & " : "
response.write objRS(3) & " : "
response.write objRS(4) & " : "
response.write objRS(5) & " : "
response.write objRS(6) & " : <br>"
objRS.MoveNext
Wend
response.write("<br>")
Dim arrResults
arrResults = objRS.getRows
Dim iRowLoop, iColLoop
For iRowLoop = 0 to UBound(arrResults, 2)
For iColLoop = 0 to UBound(arrResults, 1)
Response.Write(arrResults(iColLoop, iRowLoop) & " : ")
Next
Response.Write("<p>")
Next
.
.
.
--------------------------
here is the print out :
--------------------------
SELECT articleID, templateID, sectionID, longTitle, shortContent,
shortTitle, longContent FROM articlesLive INNER JOIN articleMeta ON
(articlesLive.articleID = articleMeta.metaID) WHERE ((statusID = 3) AND
(sectionID <> 1) AND (visible = 1)) AND (articlesLive.longContent LIKE
'%annual reports%' OR articlesLive.shortTitle LIKE '%annual reports%' OR
articlesLive.shortContent LIKE '%annual reports%' OR
articlesLive.longTitle LIKE '%annual reports%')
7 : 6 : 4 : long title : short content : Annual Reports : long content :
<--- RS
7 : 6 : 4 : long title : : : long content : <--- ARRAY
--------------------------------
any ideas ?????!!!!
Thanks
Adrian
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]