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;
}
% >