ado|asp+| Example | data |ado| sample//showdata.asp
<%@ language= "VBScript" codepage= "936"%>
<title>[show the Data]</title>
<body>
<%
Application.Lock ()
Set dataconnect = Server.CreateObject ("ADODB. Connection ")
strconnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
&server.mappath ("Db1.mdb") &_
"; Persist Security Info=true "
Dataconnect.open (StrConnect)
If Request.Form ("name") <> "" or Request.Form ("phone") then
Sqlinsertcmd = "INSERT INTO table1 (name,phone) VALUES ('" _
&request.form ("name") & "', '" &request.form ("Phone") & "')"
Dataconnect.execute (Sqlinsertcmd)
End If
Set dbtabptr = Server.CreateObject ("ADODB. Recordset ")
Dbtabptr. ActiveConnection = Dataconnect
strSQL = "SELECT * FROM table1"
Dbtabptr. Open (strSQL)
Response.Write ("<table width= ' 100% ' border= ' 1 ' >")
Response.Write ("<tr>")
Response.Write ("<th>name</th>")
Response.Write ("<th>phone</th>")
Dbtabptr. MoveFirst ()
Do until dbtabptr. Eof
Response.Write ("<tr>")
Response.Write ("<td>")
Response.Write (Dbtabptr ("name"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (Dbtabptr ("Phone"))
Response.Write ("</td>")
Response.Write ("</tr>")
Dbtabptr. MoveNext ()
Loop
Response.Write ("</tr>")
Response.Write ("</table>")
Dataconnect.close ()
Application.UnLock ()
%>
<a href= "adddata.asp" >add a Data to database</a>
</body>
Adddata.asp
<%@ language= "VBScript" codepage= "936"%>
<title>[add data]</title>
<body>
<form name= "AddData" action= "showdata.asp" method= "POST" >
<table>
<tr>
<TD align= "right" >name:</td>
<td><input name= "name" type= "text"/></td>
</tr>
<tr>