1. ASP and Access database connection: <% DIM conn, mdbfilemdbfile = server.mappath ("Database Name. MDB") set conn = server.createObject ("AdoDb.Connection" conn.open "driver = {Microsoft Access Driver * .mdb)}; uid = admin; pwd = database password; DBQ = "& mdbfile%> 2. ASP and SQL database connection: <% DIM conn = server.createObject (" adoDb.connection "Con -.open" provider = SQLOLEDB; DATA SOURCE = SQL server name or IP address; UID = SA; PWD = database password; Database = database name%> Establish record set object: SET RS = Server.createObject ("adoDb.recordset") rs.open SQL Statements, conn, 3, 23. SQL common command usage: (1) Data Record Filter: SQL = "SELECT * FROM DATA WHERE Field Name = Field Value ORDER BY Field Name [DESC]" SQL = "SELECT * FROM data Table WHERE Field Name Like '% Field Value%' ORDER BY Field Name [DESC] "SQL =" SELECT TOP 10 * FROM DATA WHERE Field Name Order By Field Name [DESC] "SQL =" SELECT * FROM Datasheet WHERE field Name in ('value 1', 'value 2', 'value 3') "SQL =" SELECT * FROM DATA WHERE Field Name BetWeen Value 1 AND Value 2 "(2) Update Data Record: SQL =" Update Data Table Set field name = field value WHERE condition expression "SQL =" Update Datasheet Set field 1 = value 1, field 2 = value 2 ... Field n = value N where condition expression "(3) Delete Data Record: SQL = "delete from data table where condition expression" SQL = "delete from data table" (4) Add Data Record: SQL = "Insert INTO Data Sheet (Field 1, Field 2, Field 3 ... VALUES (value 1, Value 2, value 3 ... "SQL =" INSERT INTO Target Data Table Select * "Add Data Table to Target Data Table) (5) Data Recording Statistics: AVG (Field Name) Out of a table column average count (* | field name) Statistics on the number of data lines or the number of data line counts for a value of a column gets the maximum value min (field name) for a table column. MIN (field name) The smallest value of the table column SUM (field name) adds the value of the value of the data column to the above function: SQL = "SELECT SUM (field name) AS alias from Datasheet WHERE Condition Expression" SET RS = Conn.Excute (SQL ) Use RS ("alias" to get the value, and other functions are used.