getstring really slow

S

Seán Meehan

Hi,

Hope somebody can help because i've looked everywhere else fo ran answer.
I'm connecting to an Access table with 100+ rows of data of approx 20
columns wide. I'm using getstring to "Quickly" display it in a table, but
it's un-useably slow. Any suggestions?

Thanks

Seán
 
R

Ray at

Code? How many people are accessing the site? Are you destroying your
objects? Does the server have a 66MHz PI?

Ray at work
 
C

Chris Hohmann

Seán Meehan said:
Hi,

Hope somebody can help because i've looked everywhere else fo ran answer.
I'm connecting to an Access table with 100+ rows of data of approx 20
columns wide. I'm using getstring to "Quickly" display it in a table, but
it's un-useably slow. Any suggestions?

Thanks

Seán
Here's an excellent article on using GetString, GetRows and recordset
iteration. <g>

http://www.aspfaq.com/show.asp?id=2467

Specifically, check out the Analysis:GetString:pros section that
discusses the use of the NumRows parameter to output a "burst" of rows.

HTH
-Chris
 
S

Seán Meehan

Ray,

I'm the only one using it at the moment for testing. It's sitting on a
dual pII 200 machine running NT4 Server. It only seems to be when I'm
trying to put the data into a table format. I've tried reading the
recordset into an array using getrows, closing the recordset and
connection and then building the table and there was no speed
difference, Yet if I just response.write straight to the screen it
displays in seconds. This rules out the database side slowing it down,
wouldn't you agree? Any help would be appreciated as it's driving me
mad.

Thanks Again,

Seán
 
S

Seán Meehan

Chris Hohmann said:
Here's an excellent article on using GetString, GetRows and recordset
iteration. <g>

http://www.aspfaq.com/show.asp?id=2467

Specifically, check out the Analysis:GetString:pros section that
discusses the use of the NumRows parameter to output a "burst" of rows.

HTH
-Chris
Excellent article Chris, although I wouldn't have thought 100 or so records
was a large amount of data to read in? I'm just doing a "Select * from
table" at the moment and I'm going to try defining the columns instead and
see whether that helps. If I ever solve this one I'll get back to you.

Regards,

Seán
 
R

Ray at

Post the relevant code snippet. One way to speed things up would be to not
do a select *. Instead, do a select [something],[somethingelse],etc. But,
I doubt that's what is causing your slowness issue.

Ray at work
 
C

Chris Hohmann

Seán Meehan said:
Excellent article Chris, although I wouldn't have thought 100 or so records
was a large amount of data to read in? I'm just doing a "Select * from
table" at the moment and I'm going to try defining the columns instead and
see whether that helps. If I ever solve this one I'll get back to you.

Regards,

Seán
Can you post some code? What's your content to formatting ratio? What I
mean is:

<style type="text/css">
td{
[[Your style definition for the td tag here]]
}
</style>
....
<td>blah blah blah</td>
<td>blah blah blah</td>
<td>blah blah blah</td>
....

Is better than:

....
<td [[A whole bunch of inline style stuff]]>blah blah blah</td>
<td [[A whole bunch of inline style stuff]]>blah blah blah</td>
<td [[A whole bunch of inline style stuff]]>blah blah blah</td>
....

HTH
-Chris
 
S

Shailesh Humbad

Try using GetRows and retrieving 1 to 10 records at a time like this:

' Prepare a SQL query string
strsql = "SELECT Field1,Field2,Field3,Field4 FROM tblData"

' Execute the SQL query and set the implicitly created recordset
Set objRS = objCN.Execute(strsql)

' Write out the results using GetRows in a loop
Response.write "<pre>"
Do While Not objRS.EOF
RecordsArray = objRS.GetRows(10)

' Print out the array
For i = 0 To UBound(RecordsArray, 2)
Response.write RecordsArray(0, i)
Response.write vbTab
Response.write RecordsArray(1, i)
Response.write vbTab
Response.write RecordsArray(2, i)
Response.write vbTab
Response.write RecordsArray(3, i)
Response.write vbTab
Response.write vbCrLf
Next
Loop
Response.write "</pre>"
 
T

Tom B

I believe the 200MHz processors were Pentium Pro's, as if it matters.

With most browsers, the entire table has to be downloaded and sized before
it can be displayed.
Your table is approximately 20 columns by 100 rows, you can speed up the
table by specifying the widths of your columns.
Another trick is to flush out part of the table. For example:

Do While not RS.EOF
iCount=iCount+1
Response.write "<tr><td>" 'etc.
if (iCount mod 10 =0) then
Response.write "</table><table>"
Response.flush
end if
RS.MoveNext
Loop

However, it's even more important to ensure that you specify column widths,
as your columns may not line up correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top