Below is the connection between ASP and access Code ~
========================================================== ======================================
ASP and Access database connection:
<% @ Language = vbs certificate %>
<%
Dim Conn, mdbfile
Mdbfile = 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
%>
========================================================== ======================================
In your example, replace conn with "database name ~
The above is the database connection code; by the way, the code for data operations after the connection:
========================================================== ======================================
1. Create a record set object:
Set rs = server. Createobject ("ADODB. recordset ")
Rs. Open SQL statement, Conn, *, * (here two parameters ~)
2. Method of record set object:
Rs. movenext moves the record pointer down a row from the current position
Rs. moveprevious transfers the record pointer from the current position up a row
Rs. movefirst moves the record pointer to the first row of the data table
Rs. movelast moves the record pointer to the last row of the data table
Rs. absoluteposition = n move the record pointer to the nth row of the data table
Rs. absolutepage = n move the record pointer to the first row of page n
Rs. pagesize = N set N records per page
Rs. pagecount returns the total number of pages based on pagesize Settings
Rs. recordcount total number of returned records
Rs. whether the BOF return record pointer exceeds the first end of the data table. True indicates yes, and false indicates no
Rs. EOF indicates whether the returned record pointer exceeds the end Of the data table. True indicates yes, and false indicates no
Rs. delete deletes the current record, but the record pointer does not move down
Rs. addnew add records to the end of the data table
Rs. update a data table record