📄 aspsql1.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示数据库表中所有记录</title>
</head>
<body>
<%
myconn=" driver={sql server};server=localhost;uid=aspnetname;pwd=123456;database=project" //连接SQl Server数据库
sqlselect="select * from 项目"
set myrecord=server.CreateObject("adodb.recordset")
myrecord.open sqlselect,myconn %>
<table border="1"><tr>
<%for i=0 to myrecord.fields.count-1 %>
<td><%=myrecord(i).name %>
<%
next %></td>
</tr>
<tr>
<% do while not myrecord.eof
for j=0 to myrecord.fields.count-1 %>
<td><%=myrecord(j)%></td>
<% next
myrecord.movenext%>
</tr>
<%loop
myrecord.close
set myrecord=nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -