Paging through long text stored in single row and column 
Author Message
 Paging through long text stored in single row and column

Hi, I hope that you can help me.

I want do do the following:

I have stories stored in a MS SQL database. I want to write an ASP page in
VBScript that calls the stored procedure in MSSQL database, requests for the
story, and shows it to the user, on the computer screen.

The problem is that I can only show a fragment of the story (500 characters)
at a time(per one screen). User needs to go to the next page to read the
second page, and go to the third page, to read the third page. In other
words, user needs to request for consecutive pages of the story to read it
all.

The entire story text is stored in a database in a single row and column. If
I do a simple SELECT statement, it will request for the entire story text,
but I can only show a fragment of it (500 characters) at a time.

What is the best way to do this? How can I do this paging? Can you give me
some ideas? Show a simplified code? Stored Procedure, Script etc..

I am pretty good with stored procedures, ASP's and VBscript. I don't expect
you to write me the entire code, but give me enough info so that I can
understand the method. The more detailed you are, the more likely I will
understand it:)

Thank you for any help,

Vanessa



Tue, 14 Jun 2005 15:07:10 GMT  
 Paging through long text stored in single row and column
Vanessa,

Depending upon the number of users you expect to have and how concerned you
are about scalability you could use one of the two methods below;

1) On the first request parse the file into pages and store the text in a
session variable along with a current page counter. Then when the user hits
the next button you check to see if the session variable is populated and if
so display the page from the session variable. Advantages: Fairly easy to
code, fast processing. Disadvantages: ties up memory per user for the
duration of the session. If you are expecting heavy loads this could chew up
a bunch of memory if the stories are large.

2) On the first request parse the file into pages and write them to a temp
directory (or back to a working table in the DB) naming the files (or keying
the DB) with a GUID and page number, store the GUID and current page in the
session or a hidden form field on your page. When the user clicks next or
back you simply retrieve the pre-parsed page from disk (or DB) for display.
Advantages: Less memory usage, more scalable. Disadvantages: A bit slower
processing for disk or DB I/O, a mechanism will need to be created to
cleanup the old files (or DB records).

Hope this helps.

--
Michael B. Murdock
MyPageSage
"Manage your Web Content by Email - Try it FREE"
http://www.mypagesage.com


Quote:
> Hi, I hope that you can help me.

> I want do do the following:

> I have stories stored in a MS SQL database. I want to write an ASP page in
> VBscript that calls the stored procedure in MSSQL database, requests for
the
> story, and shows it to the user, on the computer screen.

> The problem is that I can only show a fragment of the story (500
characters)
> at a time(per one screen). User needs to go to the next page to read the
> second page, and go to the third page, to read the third page. In other
> words, user needs to request for consecutive pages of the story to read it
> all.

> The entire story text is stored in a database in a single row and column.
If
> I do a simple SELECT statement, it will request for the entire story text,
> but I can only show a fragment of it (500 characters) at a time.

> What is the best way to do this? How can I do this paging? Can you give me
> some ideas? Show a simplified code? Stored Procedure, Script etc..

> I am pretty good with stored procedures, ASP's and VBscript. I don't
expect
> you to write me the entire code, but give me enough info so that I can
> understand the method. The more detailed you are, the more likely I will
> understand it:)

> Thank you for any help,

> Vanessa



Tue, 14 Jun 2005 20:37:15 GMT  
 Paging through long text stored in single row and column
Vanessa,

I am not sure how long the final story will be but, when faced with a
similar circumstance where a great deal of information need to be displayed
in a smaller chunks for the end user, I opted to use arrays and client side
scripting. This had a disadvantage of a slightly longer initial download but
saved multiple trips to the server. The advantages were end users could go
back and forth between data and never saw another blank screen or hourglass.

Not sure of the constraints you are under, but hope this helps.


Quote:
> Hi, I hope that you can help me.

> I want do do the following:

> I have stories stored in a MS SQL database. I want to write an ASP page in
> VBscript that calls the stored procedure in MSSQL database, requests for
the
> story, and shows it to the user, on the computer screen.

> The problem is that I can only show a fragment of the story (500
characters)
> at a time(per one screen). User needs to go to the next page to read the
> second page, and go to the third page, to read the third page. In other
> words, user needs to request for consecutive pages of the story to read it
> all.

> The entire story text is stored in a database in a single row and column.
If
> I do a simple SELECT statement, it will request for the entire story text,
> but I can only show a fragment of it (500 characters) at a time.

> What is the best way to do this? How can I do this paging? Can you give me
> some ideas? Show a simplified code? Stored Procedure, Script etc..

> I am pretty good with stored procedures, ASP's and VBscript. I don't
expect
> you to write me the entire code, but give me enough info so that I can
> understand the method. The more detailed you are, the more likely I will
> understand it:)

> Thank you for any help,

> Vanessa



Wed, 15 Jun 2005 22:30:11 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Paging through long text stored in single row and column

2. FindKey problem

3. Algorithm for Teachers Scheduling

4. Print Single Label in Specific Row and Column

5. Multiple Columns on a Single Page

6. Notifying dropped connections to MS SQL 6.5

7. HTMLBody - unable to store text in single variable - too large

8. Single-row refresh operation returned multiple row

9. Reading Long Text Column from Excel

10. Merge Two Single Page PS documents into one Single Page PS Document

11. TSR writing.

12. List View Column - - Possible items in a Single Column

 

 
Powered by phpBB® Forum Software