The Easp class provides a large number of practical ASP general processes and methods, which can simplify most ASP operations. Currently, only VBScript version is available, and the JScript version may be available in the future.
EasyASP v1.5 (updated on 2008-10-22)
New features:
1. Encapsulate the database control class (original clsDbCtrl.asp) into the Easp class. They are called through Easp.db and can also be used independently.
2. Added a new MSSQL stored procedure call method, which can flexibly call stored procedures and return the return value, record set and parameter output.
3. Added the db.CreatConn method, which can connect to the database according to the customized connection string.
4. Added the db.Json method, which can output the database record set in Json format.
5. Added db.Rand and db.RandStr methods to generate a random number or random string without duplication.
6. Added abbreviation methods for various database operation methods, which saves code writing time.
7. A large number of practical methods have been added to the Easp class, such as secure acquisition of values, anti-Sql injection, server-side form verification, etc.
Other updates:
1. Optimize db.AutoId to automatically obtain the number, which will increase the efficiency by more than 20 times, and the larger the data volume, the more obvious it will be.
2. Modify the db.OpenConn database connection method to be more in line with daily description habits.
3. Modify db.GetRecord to get record set method with fewer parameters. Fixed the bug that the conditional error was reported using array.
4. Modify and optimize the db.DeleteRecord deletion record method. Currently, there are only two parameters.
5. Modified the error debugging method and added Debug global attribute control error display.
Update instructions:
I used to write a clsDbCtrl.asp database control class, and received some feedback. Some friends sent me an email to tell me some improvement methods, thank them very much. And I saw a message in the comments of the original post saying "I have remembered the parameters, and the SQL statement has been written long ago", which directly pointed out the embarrassment. Indeed, although VBS does not have the arguments attribute, it is not a good idea to use too many parameters. So I spent some time rewritten a lot of the code of this class. On the premise that the function can only be stronger but not weaker, a method has only 3 parameters at most. In addition, a new method is added to call MSSQL stored procedures, which can flexibly call stored procedures and return one or more record sets, output parameters and return values as needed. Of course, learning from the lesson, this method has only two parameters. Now they are all encapsulated in this new guy named EasyASP. As the name suggests, it is nothing more than thinking that everything is simpler.
There is another more embarrassing thing, that is, VBScript is not an object-oriented language, so this class is actually just a wrapper of some processes and methods, which is convenient for use, so most of them can be proposed for use alone. Of course, if necessary, it can also be encapsulated as a wsc or dll component for use.
=========================================================================================
Instructions for use
=========================================================================================
1. How to use:
(1) All calls to the Easp class are already included in the easp.asp, so you only need to introduce the file at the top of the page, such as:
<!--#include file="inc/easp/easp.asp" -->
or:
<!--#include virtual="/inc/easp/easp.asp"-->
(2) This class has been instantiated and does not need to be instantiated separately. You can just call it directly using the Easp. prefix, such as: