I ue Access the ordering all records base a column with the tipical A|a selectin it work very fast...
But if i use a sql query into vba code all are very slow!!!!!!!
note:
the column to reder entire records is just indexed
speed up query order
-
- Administrator
- Posts: 78534
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: speed up query order
Access optimizes the execution of stored queries. But if you execute a SQL string in VBA, Access cannot optimize it.
Try saving the query. You can open a recordset based on a saved select query, or execute a saved action query (such as an update query or make-table query) in VBA.
Try saving the query. You can open a recordset based on a saved select query, or execute a saved action query (such as an update query or make-table query) in VBA.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: speed up query order
OK.... i know the way to open a recordset based on a saved select query, but not execute statement. can you post an example, based a query stored in Access named ORDER_RECORSHansV wrote:Access optimizes the execution of stored queries. But if you execute a SQL string in VBA, Access cannot optimize it.
Try saving the query. You can open a recordset based on a saved select query, or execute a saved action query (such as an update query or make-table query) in VBA.
-
- Administrator
- Posts: 78534
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: speed up query order
Is your query an action query, i.e. a make-table query, append query, update query or delete query?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: speed up query order
a simple order by sa:HansV wrote:Is your query an action query, i.e. a make-table query, append query, update query or delete query?
select * from table order by test
-
- Administrator
- Posts: 78534
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: speed up query order
That is a select query. You cannot execute select queries - you can open a recordset based on the query.
Best wishes,
Hans
Hans