statement when your query is relatively simple, every time you create a SQL statement from scratch is not time-consuming, however, complex queries are different, each time from scratch will produce a lot of development errors. So, once you have SQL running smoothly, you'd better save them and call them when you need them. In this way, even a simple query you can always use the stored query statement.
Let's say you have a weekly report to the team, pointing out the current business support issues that need to be selected from your database, and to select records by date, and sort by the category of support issues that your team uses. Once you have designed this query, why should you rewrite it every week? Instead of creating a query on your HTML page, you should create a query with your database tools and save it. You can then insert the query into your ASP page using the ActiveCommand attribute. The first one or two of the time you might think it's no fun, but it's just a few lines of code:
Set objsq = Server.CreateObject ("Adodb.command")
Objsq.activeconnection = "DatabaseName"
Objsq.commandtext = "Storedqueryname"
Objsq.commandtype = adCmdStoredProc
Set Objrec = Objsq.execute
Note that using adCmdStoredProc means that you have included Adovbs.inc files on the page. This file defines the access constants that you can access by name rather than by number. Just need to include the file on the page?! --#INCLUDE-->), and then you can use adCmdStoredProc names like this. This will make it easier to understand what the above stored query means in the future when you see it.