===============================
' Conn.asp
<%
Dim ConnStr
Connstr= "Provider=microsoft. Ace.oledb.12.0;data source= "& Server. MapPath ("Database/config.mdb")
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn. Open ConnStr
%>
===============================
Show_config.asp
<!--#include file=conn.asp-->
<%
Set Rs=server. CreateObject ("Adodb.recordset") ' (Build the Recordset object)
Sqlstr= "SELECT * from config" '----> (message is a data table in the database, which is the data table that you want to display)
Rs.Open sqlstr,conn,1,3 '----> (indicates how the database is opened)
Rs.movefirst '----> (move the pointer to the first record)
While not rs.eof '----> (judging if the pointer is to the end)
Response.Write (RS ("Web_name")) '----> (Displays the Name field in the data table message)
' Response.Write (RS ("info"))
' Response.Write ("<br/>")
Rs.movenext '----> (move the pointer to the next record)
Wend '----> (end of cycle)
‘------------------------------------------------------
Rs.close
Conn.close ' These words are used to close the database
Set rs=nothing
Set conn=nothing
‘-------------------------------------------------------
%>
ASP Connection Acces Database