Recordset paging when sql comes from form on same page

Recordset paging when sql comes from form on same page

Post by Jack Murph » Tue, 17 Oct 2000 12:52:45



Working on a web page to display button designs submitted by school kids.
Access db, image filename in each record, etc etc.

I have a search form (first, last, school) and an html table where the
designs are shown all in a single cell. I have the page working great if I
don't try any paging, and if only a few records are returned. Not suitable
for final version - likely more than 9 designs will be returned by some
queries.

I searched in books and on the net and found many descriptions of paging,
several of which I have followed to learn the technique. Sample pages work
like a champ if I code in the sql directly, ie don't use a form.
BUT NONE OF THE SAMPLES USE A FORM.

When I try to combine the two techniques, paging and a form, I get the first
page fine (it returns the correct records, shows the correct number of
pages, the "previous" doesn't show, the "next" appears) but when I click on
the next (or key in "?page=2" in the url) it returns all records. Even if I
key in "?page=1", which should show the first page, it shows all records.

So I'm missing something. I use a "like" operator in the sql, so I can get
partial names to work. Wonder if that might be part of the problem.

I'm at home now so I don't have the code. I can post that if needed. Is
there some incompatibility with a form creating the sql string, and paging
the records?

Any help is appreciated!
Jack Murphy

 
 
 

Recordset paging when sql comes from form on same page

Post by Adam Anderso » Thu, 19 Oct 2000 12:58:48


This is an SQL related problem, first create another table to store the all the BLOBs (images).
Use a 1 to 1 relationship to match them up in a query.
Some queries don't work on tables with a BLOB field.

> Working on a web page to display button designs submitted by school kids.
> Access db, image filename in each record, etc etc.

> I have a search form (first, last, school) and an html table where the
> designs are shown all in a single cell. I have the page working great if I
> don't try any paging, and if only a few records are returned. Not suitable
> for final version - likely more than 9 designs will be returned by some
> queries.

> I searched in books and on the net and found many descriptions of paging,
> several of which I have followed to learn the technique. Sample pages work
> like a champ if I code in the sql directly, ie don't use a form.
> BUT NONE OF THE SAMPLES USE A FORM.

> When I try to combine the two techniques, paging and a form, I get the first
> page fine (it returns the correct records, shows the correct number of
> pages, the "previous" doesn't show, the "next" appears) but when I click on
> the next (or key in "?page=2" in the url) it returns all records. Even if I
> key in "?page=1", which should show the first page, it shows all records.

> So I'm missing something. I use a "like" operator in the sql, so I can get
> partial names to work. Wonder if that might be part of the problem.

> I'm at home now so I don't have the code. I can post that if needed. Is
> there some incompatibility with a form creating the sql string, and paging
> the records?

> Any help is appreciated!
> Jack Murphy


 
 
 

Recordset paging when sql comes from form on same page

Post by Jack Murph » Sat, 21 Oct 2000 09:57:45


OK, I figured what was going on here.

The paging worked because the asp page was sending page=2, page=3, etc in
the query string for each page. What it wasnt sending was the search form
fields - ie the search form worked fine for page one, but it did exactly
what I asked it to on page two, send all records that matched the form (like
'" & lname & "%'" & fname, etc) which meant that it gave all records - the
form is blank on page 2. So just add the search form fields in the query
string along with the page number, and presto it worked.

Jack


Quote:> Working on a web page to display button designs submitted by school kids.
> Access db, image filename in each record, etc etc.

> I have a search form (first, last, school) and an html table where the
> designs are shown all in a single cell. I have the page working great if I
> don't try any paging, and if only a few records are returned. Not suitable
> for final version - likely more than 9 designs will be returned by some
> queries.

> I searched in books and on the net and found many descriptions of paging,
> several of which I have followed to learn the technique. Sample pages work
> like a champ if I code in the sql directly, ie don't use a form.
> BUT NONE OF THE SAMPLES USE A FORM.

> When I try to combine the two techniques, paging and a form, I get the
first
> page fine (it returns the correct records, shows the correct number of
> pages, the "previous" doesn't show, the "next" appears) but when I click
on
> the next (or key in "?page=2" in the url) it returns all records. Even if
I
> key in "?page=1", which should show the first page, it shows all records.

> So I'm missing something. I use a "like" operator in the sql, so I can get
> partial names to work. Wonder if that might be part of the problem.

> I'm at home now so I don't have the code. I can post that if needed. Is
> there some incompatibility with a form creating the sql string, and paging
> the records?

> Any help is appreciated!
> Jack Murphy