Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2004, 08:53 PM
Authorized User
 
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Optimize

This is a combobox inside a form. The problem is that is grabs from a table with about 40,000 records, which is probaly pretty silly. Is there a way I can optimize this. Maybe with a stored proc, would that help any? Any suggestions would be appreciated.


<%
SET rs = server.CreateObject("ADODB.RECORDSET")
rs.Open "SELECT ps_Id AS Value, Ps_CodFab AS Nombre FROM TbNvLpPsMaestroGrl ORDER BY Ps_CodFab", conn, adOpenStatic, adLockReadOnly
%>



                <TD class=DetalleTitulo>&nbsp;Componente</TD>
                <TD class=DetalleDato>
                <SELECT id="Cmb1" name=ps_Id tabindex="3">
                <OPTION value="">Componentes</OPTION>
                <%Do While Not rs.EOF%>
                <OPTION value="<%=rs.Fields("Value")%>" <%If Trim(Request.QueryString("ps_Id")) = Trim(rs.Fields("Value")) Then%>selected<%End If%>><%=rs.Fields("Nombre")%></OPTION>
                <%rs.MoveNext
                Loop%></SELECT>


<%
rs.Close
set rs = nothing
%>

 
Old February 10th, 2004, 11:20 AM
Authorized User
 
Join Date: Dec 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there any logical filter that can be applied before creating the dynamic combo list

\John

 
Old February 10th, 2004, 12:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

IMO, the problem is not necessary with the performance. I think you're not going to fix this with a sproc. That is, it might be faster than it is now, but IMO you should reconsider your design.
Your users are not going to be happy when you present them with 40,000!! items in a drop-down.....

How about a smarter interface, like a search box where they can narrow down the list?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 10th, 2004, 02:08 PM
Authorized User
 
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I created a search list with filters and stuff. Your right!






Similar Threads
Thread Thread Starter Forum Replies Last Post
optimize inesrt to MDB ishaywei Classic ASP Databases 1 November 27th, 2006 10:36 PM
to optimize the code-urgent mikedeepak Classic ASP Professional 1 November 4th, 2005 03:00 AM
Optimize SQL Statement JpJoe Access 1 June 7th, 2005 08:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.