<!--#include file="pubdb.asp"-->
<%
'*****************************************
'类型:函数
'目的:报错
'参数:
'a_num:报错信息参数
'*****************************************
private function showerror(a_num)
dim serrinfo
serrinfo = ""
response.write("<p>error number:era_" & a_num & "</p>")
select case a_num
case "1000"
serrinfo = "参数类型不正确,请检查"
case "1100"
serrinfo = "无法打开数据库连接"
case else
serrinfo = "发现未知错误,请与管理员联系"
end select
serrinfo = "<p>error description:" & serrinfo & "</p>"
response.write(serrinfo)
response.end
end function
dim ors,shtml
call opendb()
set ors = oconn.openschema(20)
shtml=""
ors.movefirst
'循环读取数据库中的表名
do while not ors.eof
if ucase(ors(3))="table" then
stemp = trim(ors(2))
if stbname = stemp then
shtml= shtml & space(2) & "<option value=""" & stemp & """ selected=""selected"">" & stemp & "</option>" & chr(10)
else
shtml= shtml & space(2) & "<option value=""" & stemp & """>" & stemp & "</option>" & chr(10)
end if
end if
ors.movenext
loop
call closedb()
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>数据库名</title>
<script type="text/javascript">
<!--
var sdstid="";
function serverresult(a_surl,a_ssrcid,a_sdstid) {
var svalue = document.getelementbyid(a_ssrcid).value;
sdstid=a_sdstid;
if ((svalue == null) || (svalue == "")) return;
var surl = a_surl+svalue;
oxml.open("get", surl,true);
oxml.onreadystatechange = updatedata;
oxml.send(null);
}
function updatedata() {
var aelmnts = sdstid.split(',');
var oelmnt = null;
var atags=null;
var oxmldata=null;
if ((oxml.readystate == 4) && (oxml.status == 200)) {
atags = oxml.responsexml.documentelement.getelementsbytagname("cjjitem");
if (atags.length!=aelmnts.length) {
alert('获取的服务器端的数据错误!');
return null;
}
for (var i=0;i<aelmnts.length ;i++ ) {
oelmnt = document.getelementbyid(aelmnts[i]);
oelmnt.innerhtml=atags[i].firstchild.data;
}
}
return true;
}
var oxml = false;
if (window.activexobject) {
oxml = new activexobject("microsoft.xmlhttp");
} else if (window.xmlhttprequest) {
oxml=new xmlhttprequest();
}
//-->
</script>
</head>
<body>
<form method="post" name="form1" action="addformdata.asp">
<p> </p>
<p>数据库名:<input type="text" name="txtdbname" size="7" value="work"> 数据库用户名:<input type="text" name="dbusername" size="8" value="sa">数据库密码:<input type="password" name="dbuserpassword" size="10" value=""> 数据库服务器路径:<input type="text" name="dbserverpath" size="20" value="127.0.0.1"></p>
<p>数据表名:<select size="1" id="slttbname" name="slttbname" onchange="serverresult('getfieldlist.asp?n=','slttbname','fieldcount,tblfields');">
<option selected="selected">请选择一个表</option>
<%=shtml%>
</select></p>
<div id="fieldcount">表字段个数:<input type="text" id="txtfldcount" name="txtfldcount" value="0" /></div>
<table id="tblfields" border="1" width="91%">
<thead>
<tr>
<td align="center" width="94">字段名</td>
<td align="center" width="113">字段类型</td>
<td width="27" align="center">使用</td>
<td width="18" align="center">只读</td>
<td align="center" width="80">表单项类型</td>
<td align="center" width="100">表单项名称</td>
<td align="center" width="92">表单项描述</td>
<td align="center" width="87">表单项验证</td>
<td align="center">表单项默认值</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
<p align="left">需要生成的动态asp网页类型:<select size="1" name="sltasptype">
<option value="0">数据添加</option>
<option value="1">数据编辑</option>
<option value="2">数据删除</option>
<option value="3">数据管理</option>
<option value="4">数据列表</option>
</select> 文件名:<input type="text" name="txtfilename" size="17" value="">
文件类型:<select size="1" name="sltfiletype">
<option value="asp">asp</option>
<option value="php">php</option>
<option value="jsp">jsp</option>
<option value="perl">perl</option>
<option value="vb.net">vb.net</option>
<option value="c#">c#</option>
</select>
<input type="submit" value="生成文件" name="action"></p>
</form>
</body>
</html>
如对本文有疑问, 点击进行留言回复!!
asp中Request.ServerVariables的参数集合
网友评论