ASP Connection Acces Database

Source: Internet
Author: User

===============================

' 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.