!--#include file="pubdb.asp"-->
%
'*****************************************
'類(lèi)型:函數(shù)
'目的:報(bào)錯(cuò)
'參數(shù):
'a_num:報(bào)錯(cuò)信息參數(shù)
'*****************************************
Private Function ShowError(a_Num)
Dim sErrInfo
sErrInfo = ""
Response.Write("p>Error Number:era_" a_Num "/p>")
Select Case a_Num
Case "1000"
sErrInfo = "參數(shù)類(lèi)型不正確,請(qǐng)檢查"
Case "1100"
sErrInfo = "無(wú)法打開(kāi)數(shù)據(jù)庫(kù)連接"
Case Else
sErrInfo = "發(fā)現(xiàn)未知錯(cuò)誤,請(qǐng)與管理員聯(lián)系"
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
'循環(huán)讀取數(shù)據(jù)庫(kù)中的表名
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>數(shù)據(jù)庫(kù)名/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('獲取的服務(wù)器端的數(shù)據(jù)錯(cuò)誤!');
return null;
}
for (var i=0;iaElmnts.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>數(shù)據(jù)庫(kù)名:input type="text" name="txtDBName" size="7" value="work"> 數(shù)據(jù)庫(kù)用戶(hù)名:input type="text" name="DBUserName" size="8" value="sa">數(shù)據(jù)庫(kù)密碼:input type="password" name="DBUserPassWord" size="10" value=""> 數(shù)據(jù)庫(kù)服務(wù)器路徑:input type="text" name="DBServerPath" size="20" value="127.0.0.1">/p>
p>數(shù)據(jù)表名:select size="1" id="sltTBName" name="sltTBName" onchange="serverResult('getFieldList.asp?n=','sltTBName','fieldcount,tblFields');">
option selected="selected">請(qǐng)選擇一個(gè)表/option>
%=sHtml%>
/select>/p>
div id="fieldcount">表字段個(gè)數(shù):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">字段類(lèi)型/td>
td width="27" align="center">使用/td>
td width="18" align="center">只讀/td>
td align="center" width="80">表單項(xiàng)類(lèi)型/td>
td align="center" width="100">表單項(xiàng)名稱(chēng)/td>
td align="center" width="92">表單項(xiàng)描述/td>
td align="center" width="87">表單項(xiàng)驗(yàn)證/td>
td align="center">表單項(xiàng)默認(rèn)值/td>
/tr>
/thead>
tbody>
/tbody>
/table>
p align="left">需要生成的動(dòng)態(tài)ASP網(wǎng)頁(yè)類(lèi)型:select size="1" name="sltAspType">
option value="0">數(shù)據(jù)添加/option>
option value="1">數(shù)據(jù)編輯/option>
option value="2">數(shù)據(jù)刪除/option>
option value="3">數(shù)據(jù)管理/option>
option value="4">數(shù)據(jù)列表/option>
/select> 文件名:input type="text" name="txtFileName" size="17" value="">
文件類(lèi)型: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>