有关web数据库查询啦!大虾帮帮我啦!

freebyte 2001-07-12 11:58:49
我正在做一个学校的主页,我想实现学校成绩的查询, 当然是基于浏览器页面的查询啦,有关数据库查询!
可我对jsp,java,不大了解,会点pb,和一点做主页工具,大虾请务必请帮帮我啦!这边先行谢过了,最好能发过来源代码,我感激不尽!!!
...全文
32 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
freebyte 2001-07-13
非常感谢!帮助!!
回复
lemonade 2001-07-13
<%@ LANGUAGE="JAVASCRIPT" %>
<!-- #include file="adojavas.inc" -->

<html>
<head>
<title>Deleting Data From Database: Using Stored Proc</title>
</head>
<body>
<%

var conn = Server.CreateObject("ADODB.Connection");
var recordSet = Server.CreateObject("ADODB.RecordSet");
var numRec;

conn.open("DSN=asp_devguide2");

Response.Write("<h1>Before Delete</h1>");
recordSet.Open("select * from products",conn);

Response.Write("<table border=1>");

while(!recordSet.EOF)
{
Response.Write("<tr>");

Response.Write("<td>");
Response.Write(recordSet("name"));
Response.Write("</td>");

Response.Write("<td>");
Response.Write(recordSet("msrp"));
Response.Write("</td>");

Response.Write("</tr>");

recordSet.MoveNext();
}

Response.Write("</table>");

numRec = -1;
conn.execute("deleteAbove(50.0)",numRec,adCmdStoredProc);

if(numRec == 1)
Response.Write("<h2>Deleteted "+numRec+" row.</h2>")
else
Response.Write("<h2>Deleteted "+numRec+" rows.</h2>")

recordSet.Close();
recordSet.Open("select * from products",conn);

Response.Write("<h1>After Delete</h1>");

Response.Write("<table border=1>");

while(!recordSet.EOF)
{
Response.Write("<tr>");

Response.Write("<td>");
Response.Write(recordSet("name"));
Response.Write("</td>");

Response.Write("<td>");
Response.Write(recordSet("msrp"));
Response.Write("</td>");

Response.Write("</tr>");

recordSet.MoveNext();
}

Response.Write("</table>");

conn.close();
conn = null;

%>

</body>
</html>

that's it
回复
dotnba 2001-07-13
迟了
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2001-07-12 11:58
社区公告
暂无公告