Solved

Using getrows() in asp with dynamic linking

Posted on 2007-03-26
7
324 Views
Last Modified: 2013-11-19
I am using ASP and an Access database to display a large amount of data on one page. Those, unfortunately, are my constraints.
There are thousands of records, and looping through the database to create a new row for each record is usually ok. However the problem arrises when I want to link a field in that database to another page based on a number in the database. E.g.:
name = RS("S_FNAME") + " " + RS("S_LNAME")
response.write "<a href=task.asp?S_NUMBER=" & RS("S_NUMBER") & ">" & name & "</a>"

However, with all of that extra HTML thrown in there, the returned page is about 750kb worth of HTML.... which is a very slow return. I come to find out that getrows() is a much more efficient way of returning vast amounts of database data, but I have no clue in trying to use getrows with the task I need completed.

So, hopefuly you all have some times for me!

Thanks

Devin
0
Comment
Question by:Zorkinhimerlingling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 84
ID: 18798858
GetRows returns a multidimensional array of data with fieldnames. Can you pass an array with a URL? I'm not sure, but I don't think you can.

It sounds as if you're trying to build a webpage based on a "number' in the database ... if that's the case, then why not just pass the number in the URL using the Get method (as you're apparently doing now) and then use ASP code to open the database, retrieve the record, and build the new page?

Assuming I'm reading this right, that is ....
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18800022
can you give us a bit more of the website logic ... open a huge page with all people listed in a table, the user then enters a nuber from one of the records and it navigates them to another page that only shows the information for the one record number they entered? I *think* this is the scenario LSM is covering.
0
 
LVL 1

Author Comment

by:Zorkinhimerlingling
ID: 18802566
Sure, I probably didn't explain the works in enough detail. So, here is the primary bit of code.
Do While Not RS.EOF
S_NUMBER = RS("S_NUMBER")
Response.Write ("<tr>")
Response.Write ("<td><a target=top href=task.asp?S_NUMBER=" & S_NUMBER & ">" & RS("S_LNAME") & " " & RS("S_FNAME") & "</a></td>")
Response.Write ("<td>" & RS("S_HOURS") & "</td>")
Response.Write ("<td>" & RS("S_EXPIRE") & "</td>")
Response.Write ("<td>" & S_NUMBER & "</td>")
Response.Write ("</tr>")
RS.Movenext
loop
end if


as you can see, the link I generate around the first and last name has a field value within it, and I'm not sure how to accomplish this via getrows. thanks
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 1

Author Comment

by:Zorkinhimerlingling
ID: 18802786
Well, it would seem that I have found the solution to my problem! and it works beautifully! I grab the entire db using getrows and just display them in a for loop! sorry guys
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18803052
Too late I guess, but you just do

dbArray = rs.getRows() to put the data in an array so you can close the RS immediately the loop through the array rather than an ope record set, which should be faster.

http://www.rodsdot.com/ee/How-to-use-getrows-ASP.asp

For future reference.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 19230387
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question