Ask a Question related to Coldfusion Database Access, Design and Development.
-
badLarry #1
Getting selected rows out of an access database
I'm currently using this code to output my blog entries. The problem i'm having
is getting all the information from the database everytime is slowing down the
server a little. Is there a way to only get 10 entries at a time from the
database, and incrementing that through <cfquery> instead of <cfoutput>?
<cfquery name="blogEntry" datasource="#request.dsn#">
SELECT *
FROM entry
ORDER BY entryID DESC
</cfquery>
<cfoutput query="blogEntry" maxrows="10" startrow="#url.startrow#">
**formatting**
</cfoutput>
badLarry Guest
-
#39643 [NEW]: Integers selected from a MySQL-database are treated as strings
From: harmen_php_net at xtremesf dot nl Operating system: PHP version: 5.2.0 PHP Bug Type: MySQLi related Bug description: ... -
Getting a list of ID's from Selected Rows
What I am trying to do is gets a list of the attribute ID's for each selected row. What I was wondering was if there was a way to loop through the... -
[PHP-DEV] database driver: no more rows
Hi, I would appreciate it if the database extensions would no longer return false when no rows are left in the result set but instead return... -
how to return all rows selected in subroutine?
Howdy: I am trying to return an array of all records in the subroutine below. I want to hold all of that info in one location so that I can... -
user access to only selected pages
Some time ago I set up an ASP application that used a login page which checked a username and password against a database to determine a users... -
MikerRoo #2
Re: Getting selected rows out of an access database
If the query data does not change much, cache the query.
Two things that can make an immediate impact:
Don't use "SELECT *"! List only the columns that are needed, this can save
quite a bit of time and memory.
Use TOP in the query itself to limit the actual data.
For example:
Set iLastRow = StartRow + maxrows
Then, use:
SELECT TOP #iLastRow#
Column A, Column B, Column C, etc.
FROM entry ... ...
There are ways to limit Access to just the 10 records desired but they require
redesigning the actual query somewhat (Use "TOP" and self joins).
Note that you can use the maxrows attribute in cfquery but that does not
usually help much.
MikerRoo Guest
-
badLarry #3
Re: Getting selected rows out of an access database
Thanks Mike. I'm using the SELECT * because I do use all the columns in the table. But I tried using TOP in the statement like you suggested and it was exactly what I was looking for . Thanks a ton.
badLarry Guest



Reply With Quote

