asp下如何在ADO服务器端利用好缓存技术?
程序员文章站
2022-07-12 08:17:04
请看下面示例,这是一个用来显示图书分类的例子程序: displaybooks.asp < %@ language=javascript ...
请看下面示例,这是一个用来显示图书分类的例子程序:
displaybooks.asp
< %@ language=javascript % >
< html >
< body >
< form method=post >
图书分类; < %= getbookslistbox() % >
< p>
< input type=submit >
< %
function getbookslistbox()
{
bookslistbox = application("bookslistbox")
if (bookslistbox != null) return bookslistbox;
crlf = string.fromcharcode(13, 10)
bookslistbox = "< select name=books>" + crlf;
sql = "select * from books order by name";
cnnbooks = server.createobject("adodb.connection");
cnnbooks.open("books", "admin","");
rstbooks = cnnbooks.execute(sql);
fldbookname = rstbooks("bookname");
while (!rstbooks.eof){
bookslistbox = bookslistbox + " < option>" +
fldbookname + "" + crlf;
rstbooks.movenext();
}
bookslistbox = bookslistbox + ""
application("bookslistbox") = bookslistbox
' 注意这句,application技术的精华应哦
return bookslistbox;
}
% >
displaybooks.asp
< %@ language=javascript % >
< html >
< body >
< form method=post >
图书分类; < %= getbookslistbox() % >
< p>
< input type=submit >
< %
function getbookslistbox()
{
bookslistbox = application("bookslistbox")
if (bookslistbox != null) return bookslistbox;
crlf = string.fromcharcode(13, 10)
bookslistbox = "< select name=books>" + crlf;
sql = "select * from books order by name";
cnnbooks = server.createobject("adodb.connection");
cnnbooks.open("books", "admin","");
rstbooks = cnnbooks.execute(sql);
fldbookname = rstbooks("bookname");
while (!rstbooks.eof){
bookslistbox = bookslistbox + " < option>" +
fldbookname + "" + crlf;
rstbooks.movenext();
}
bookslistbox = bookslistbox + ""
application("bookslistbox") = bookslistbox
' 注意这句,application技术的精华应哦
return bookslistbox;
}
% >
上一篇: 用javascript解决外部数据抓取中的乱码问题
下一篇: 虚拟主机重启代码