Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Unexpected Query Results


Message #1 by "Young, Ashley" <Ashley.Young@c...> on Mon, 9 Dec 2002 12:49:42 -0500
Hi, everyone. I'm having trouble with a simple query. I have a database of
customers with a field called ContactToBuy. The field is a text field that
either contains "Yes","No", or is null. I want to pull just the records that
are not No. The query seems to work fine:

SELECT * FROM table WHERE NOT ContactToBuy='No'

The problem is that when I refresh the ASP web page that displays the record
information, the same record is pulled over and over. I want the webpage to
cycle through the records on a random basis. Am I doing something wrong?

Any help is appreciated. Thanks in advance!

--Ashley

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 
Message #2 by "Vandana Sahasrabudhe" <panipuri99@h...> on Mon, 9 Dec 2002 19:07:20
r u looping through the database while displaying the records?




> Hi, everyone. I'm having trouble with a simple query. I have a database 
of
customers with a field called ContactToBuy. The field is a text field that
either contains "Yes","No", or is null. I want to pull just the records 
that
are not No. The query seems to work fine:

SELECT * FROM table WHERE NOT ContactToBuy='No'

The problem is that when I refresh the ASP web page that displays the 
record
information, the same record is pulled over and over. I want the webpage to
cycle through the records on a random basis. Am I doing something wrong?

Any help is appreciated. Thanks in advance!

--Ashley

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 
Message #3 by "Young, Ashley" <Ashley.Young@c...> on Mon, 9 Dec 2002 13:54:20 -0500
I don't want to display all the records at once. I just want to display one
page full of information per record at a time. ;)

--Ashley

-----Original Message-----
From: Vandana Sahasrabudhe [mailto:panipuri99@h...]
Sent: Monday, December 09, 2002 1:07 PM
To: Access ASP
Subject: [access_asp] Re: Unexpected Query Results


r u looping through the database while displaying the records?




> Hi, everyone. I'm having trouble with a simple query. I have a database 
of
customers with a field called ContactToBuy. The field is a text field that
either contains "Yes","No", or is null. I want to pull just the records 
that
are not No. The query seems to work fine:

SELECT * FROM table WHERE NOT ContactToBuy='No'

The problem is that when I refresh the ASP web page that displays the 
record
information, the same record is pulled over and over. I want the webpage to
cycle through the records on a random basis. Am I doing something wrong?

Any help is appreciated. Thanks in advance!

--Ashley

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 
Message #4 by panipuri99@h... on Mon, 9 Dec 2002 19:25:21
try generating a random number ans the use it in SQL statement 

SELECT * FROM table WHERE NOT ContactToBuy='No' AND recordID=rndNumber

> I don't want to display all the records at once. I just want to display 
one
page full of information per record at a time. ;)

--Ashley

-----Original Message-----
From: Vandana Sahasrabudhe [mailto:panipuri99@h...]
Sent: Monday, December 09, 2002 1:07 PM
To: Access ASP
Subject: [access_asp] Re: Unexpected Query Results


r u looping through the database while displaying the records?




> Hi, everyone. I'm having trouble with a simple query. I have a database 
of
customers with a field called ContactToBuy. The field is a text field that
either contains "Yes","No", or is null. I want to pull just the records 
that
are not No. The query seems to work fine:

SELECT * FROM table WHERE NOT ContactToBuy='No'

The problem is that when I refresh the ASP web page that displays the 
record
information, the same record is pulled over and over. I want the webpage to
cycle through the records on a random basis. Am I doing something wrong?

Any help is appreciated. Thanks in advance!

--Ashley

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
 
Message #5 by "Ken Schaefer" <ken@a...> on Tue, 10 Dec 2002 11:05:57 +1100
Do you want to *page* the data (ie display the nth record with back | next
buttons) or do you want to randomly select a record (even though it means
you could be viewing the same record over and over)?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Young, Ashley" <Ashley.Young@c...>
Subject: [access_asp] Unexpected Query Results


: Hi, everyone. I'm having trouble with a simple query. I have a database of
: customers with a field called ContactToBuy. The field is a text field that
: either contains "Yes","No", or is null. I want to pull just the records
that
: are not No. The query seems to work fine:
:
: SELECT * FROM table WHERE NOT ContactToBuy='No'
:
: The problem is that when I refresh the ASP web page that displays the
record
: information, the same record is pulled over and over. I want the webpage
to
: cycle through the records on a random basis. Am I doing something wrong?
:
: Any help is appreciated. Thanks in advance!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #6 by "Larry Woods" <larry@l...> on Tue, 10 Dec 2002 07:43:20 -0700
If you want to "walk" through the recordset 1 record at a time,
and ASSUMING that the recordset is static; i.e., no one is
adding/deleting records during the session, then you can use the
AbsolutePosition property.  It starts at 1, and can be set as
well as read.

PROCEDURE:

Open the recordset as Static, not ForwardOnly.

Set the AbsolutePosition equal to the record that you want to
read ( 1-N ).  Get "N" from RecordCount, which is available since
you have set your cursor to Static.

The recordset will positioned to that record.  Then, just get the
fields from the recordset.

To keep track of where you are in the recordset, send a HIDDEN
INPUT tag back to the browser, then read it upon return.  Use the
HIDDEN value to "reset" the recordset to the record that you
want.

Hope this helps....

Larry Woods
l.woods, inc.
Scottsdale, Arizona
xxx.xxx.xxxx


> -----Original Message-----
> From: Young, Ashley [mailto:Ashley.Young@c...]
> Sent: Monday, December 09, 2002 10:50 AM
> To: Access ASP
> Subject: [access_asp] Unexpected Query Results
>
>
> Hi, everyone. I'm having trouble with a simple query.
> I have a database of
> customers with a field called ContactToBuy. The field
> is a text field that
> either contains "Yes","No", or is null. I want to pull
> just the records that
> are not No. The query seems to work fine:
>
> SELECT * FROM table WHERE NOT ContactToBuy='No'
>
> The problem is that when I refresh the ASP web page
> that displays the record
> information, the same record is pulled over and over.
> I want the webpage to
> cycle through the records on a random basis. Am I
> doing something wrong?
>
> Any help is appreciated. Thanks in advance!
>
> --Ashley
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.377 / Virus Database: 211 - Release Date:
> 7/15/2002
>
>

Message #7 by "Ken Schaefer" <ken@a...> on Wed, 11 Dec 2002 15:42:33 +1100
This is really, really, slow...

Use adOpenForwardOnly and just .Move() to the record you want to start at.
Use .getRows(n) to gulp the number of records you want.

Depending on the size of the underlying result-set you can be looking at 20%
(for small recordsets) or more of a performance loss when moving to
adOpenStatic cursors. I saw a 40% performance loss when the underlying
resultset was about 800 records, and it just keeps going up...

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Larry Woods" <larry@l...>
Subject: [access_asp] RE: Unexpected Query Results


: If you want to "walk" through the recordset 1 record at a time,
: and ASSUMING that the recordset is static; i.e., no one is
: adding/deleting records during the session, then you can use the
: AbsolutePosition property.  It starts at 1, and can be set as
: well as read.
:
: PROCEDURE:
:
: Open the recordset as Static, not ForwardOnly.
:
: Set the AbsolutePosition equal to the record that you want to
: read ( 1-N ).  Get "N" from RecordCount, which is available since
: you have set your cursor to Static.
:
: The recordset will positioned to that record.  Then, just get the
: fields from the recordset.
:
: To keep track of where you are in the recordset, send a HIDDEN
: INPUT tag back to the browser, then read it upon return.  Use the
: HIDDEN value to "reset" the recordset to the record that you
: want.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #8 by "Larry Woods" <larry@l...> on Wed, 11 Dec 2002 10:40:44 -0700
Ken,

So, you are suggesting that you download ALL of the records in
the recordset for each record that is needed?  And, a .getrow for
800 records is faster than an AbsolutePosition read?  I'll have
to try this out.  Amazing!

Larry


> -----Original Message-----
> From: Ken Schaefer [mailto:ken@a...]
> Sent: Tuesday, December 10, 2002 9:43 PM
> To: Access ASP
> Subject: [access_asp] RE: Unexpected Query Results
>
>
> This is really, really, slow...
>
> Use adOpenForwardOnly and just .Move() to the record
> you want to start at.
> Use .getRows(n) to gulp the number of records you want.
>
> Depending on the size of the underlying result-set you
> can be looking at 20%
> (for small recordsets) or more of a performance loss
> when moving to
> adOpenStatic cursors. I saw a 40% performance loss
> when the underlying
> resultset was about 800 records, and it just keeps going up...
>
> Cheers
> Ken
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Larry Woods" <larry@l...>
> Subject: [access_asp] RE: Unexpected Query Results
>
>
> : If you want to "walk" through the recordset 1 record
> at a time,
> : and ASSUMING that the recordset is static; i.e., no one is
> : adding/deleting records during the session, then you
> can use the
> : AbsolutePosition property.  It starts at 1, and can be set as
> : well as read.
> :
> : PROCEDURE:
> :
> : Open the recordset as Static, not ForwardOnly.
> :
> : Set the AbsolutePosition equal to the record that you want to
> : read ( 1-N ).  Get "N" from RecordCount, which is
> available since
> : you have set your cursor to Static.
> :
> : The recordset will positioned to that record.  Then,
> just get the
> : fields from the recordset.
> :
> : To keep track of where you are in the recordset,
> send a HIDDEN
> : INPUT tag back to the browser, then read it upon
> return.  Use the
> : HIDDEN value to "reset" the recordset to the record that you
> : want.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>


  Return to Index