08_01.asp

来自「ASPTest 网络基础网页设计」· ASP 代码 · 共 36 行

ASP
36 行
字号
<html>
<head>
<title>连接对象的Execute方法示例</title>
</head>
<body>
<% 
Dim cn,rs
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Driver={SQL Server};Server=yangwu;Database=ASPTest;" & _
          "UID=sa;PWD=admin"
cn.Execute ("Insert Chapter1(ID,PWD,Email) Values('qhl','321a'," &_
               "'pp0712@263.net')")
Set rs = cn.Execute ("SELECT * FROM Chapter1")
%>
<p align="center"><span lang="zh-cn">已注册ID列表</span></p>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" width="336" align=center>
  <tr>
    <td width="97">注册ID</td>
    <td width="97">注册密码</td>
    <td width="138">Email地址</td>
  </tr>
<% 
Do While Not rs.Eof 
%>  
  <tr>
    <td width="97"><%=rs(0)%> </td>
    <td width="97"><%=rs(1)%> </td>
    <td width="138"><%=rs(2)%> </td>
  </tr>
<%   
  If Not rs.Eof Then rs.MoveNext
Loop
%>   
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?