asp操作数据库的ui
<!--#include file="conn.asp"-->
<!--#include file="inc/head.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" xmlns:qz="http://qzone.qq.com/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
<title>测试</title>
</head>
<body style="margin:10px;">
<form action="" method="post">
<textarea name=sql rows=5 style="width:100%" onkeypress="if(event.keyCode==10)submit.click()"><%=request("sql")%></textarea><BR>
<input type=submit id=submit style="width:20%" >
<input type=input name=pass style="width:75%" value="<%=request("pass")%>">
</form>
<%
function tip(text)
response.write(text)
end function
if request("sql") = "" then
tip ("缺少sql语句<BR>")
elseif request("pass") <> "pass" then
tip ("密码不对<BR>")
else
dosql()
end if
sub dosql()
dim result, startTime, lastId, ri
startTime = now()
set result = conn.execute(request("sql"))
if result.State = 1 then
while( result.EOF = False )
for ri = 0 to 999
on error resume next
tip ri&". "&result(ri).name & ": " & result(ri) & "<BR>"
if err.number <> 0 then
exit for
&n
相关文档:
接下来开始讲解如何用三层架构来建立用户登录过程.
这个过程用一般的编程方式写起来很简单,从这里入手来讲解三层架构的实例,想必大家都会更容易了解其中的逻辑结构.
首先我们做一些准备工作,构造这个业务需要用到的几个类,其中包括三个部 ......
在 ASP 中,有两个很常用的集合,一个是 Request.QueryString,另一个是 Request.Form。这两个集合可以获取 HTML 表单(HTML Forms) 提交的信息。
有关 HTML 表单,请参见 HTML 教程中的 HTML表单 一章。
Request.QueryString
HTML 表单中的 method 有两种,一种是 get,另外一种是 post。当 HTML 表单的 metho ......
HTML部分:
<asp:Chart ID="ChartBar" runat="server" Width="800px" BackColor="#FFFFCC" Palette="BrightPastel" BorderWidth = "2" BorderColor = "#cc9900" >
& ......
<%
'true=是邮件;false=不是;
Function validate(ByVal str)
Dim temp,reg
Set reg = new regexp
reg.ignorecase=true
reg.global=true
reg.pattern = "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
validate = reg.test(Trim(str))
Set reg = Nothing
End Function
'************************ ......