|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp是基于web的一种编程技术,可以说是cgi的一种。它可以完成以往cgi程序的所有功能,如计数器、留言簿、公告板、聊天室等等。数据|数据库良多人必定用过QueryAnalyzer,这个工具的功效怎样怎样,就不必我说了,此次给人人先容下Web下的QueryAnalyzer,界面如,利用ASP写的。
()
源程序以下:
<%
dimconn
dimconnstr
onerrorresumenext
ifrequest("selectdb")="mdb"then
ifrequest("dbname")""then
connstr="DBQ="+server.mappath(request("dbname"))+";DefaultDir=;DRIVER={MicrosoftAccessDriver(*.mdb)};"
setconn=server.createobject("ADODB.CONNECTION")
iferr.number0then
err.clear
setconn=nothing
response.write"毛病:数据库毗连堕落!"
else
ifrequest("dbpass")""then
conn.openconnstr
else
Conn.Openconnstr,"admin",request("dbpass")
endif
iferrthen
setconn=nothing
response.write"毛病:数据库毗连堕落!!!<br>"+err.description
err.clear
endif
endif
endif
elseifrequest("selectdb")="mssql"then
ifrequest("dbname")""then
connstr="Provider=SQLOLEDB.1"
connstr=connstr&";DataSource="&request("sqlip")sql_server数据库
connstr=connstr&";UserID="&request("sqladmin")数据库服务器用户
connstr=connstr&";Password="&request("sqlpass")登录口令
connstr=connstr&";InitialCatalog="&request("sqldb")数据库名
setconn=server.createobject("ADODB.CONNECTION")
iferr.number0then
err.clear
setconn=nothing
response.write"毛病:数据库毗连堕落!"
else
conn.openconnstr
iferrthen
setconn=nothing
response.write"毛病:数据库毗连堕落!!!<br>"+err.description
err.clear
endif
endif
endif
endif
subendConnection()
conn.close
setconn=nothing
endsub
%>
<HTML>
<HEAD>
<TITLE>QueryAnalyzer</TITLE>
<STYLEtype=text/CSS>BODY{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZE:9pt}
P{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZE:9pt}
BR{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZE:9pt}
TD{FONT-FAMILY:"宋体","ArialNarrow","TimesNewRoman";FONT-SIZE:9pt}
.p9{FONT-SIZE:9pt;LINE-HEIGHT:14pt}
A:link{COLOR:#004080;FONT-SIZE:9pt;LINE-HEIGHT:14pt;TEXT-DECORATION:none}
A:visited{COLOR:#004080;FONT-SIZE:9pt;LINE-HEIGHT:14pt;TEXT-DECORATION:none}
A:hover{COLOR:#ff0000;FONT-SIZE:9pt;LINE-HEIGHT:14pt;TEXT-DECORATION:underline}
.p105{FONT-SIZE:10.5pt}
INPUT.yellowbtn{BACKGROUND-COLOR:#88a3f2;COLOR:#000000;FONT-SIZE:9pt}
</STYLE>
</HEAD>
<BODYBGCOLOR="#FFFFFF"topmargin="0">
<scriptlanguage=JavaScript>
functionsetWB(x){
document.main.whichbutton.value=x;
document.main.submit();
}
functionshowSQL(x){
sqlvalue=document.main.sql.value;
if(x==0){
smsg="
如何利用sql语句匡助:
";
smsg=smsg+"1.在选择框里选一个命令
";
smsg=smsg+"2.点击[显现]按钮
";
smsg=smsg+"3.sql语句会显现在右边的文本框内里
";
smsg=smsg+"4.修正此语句来合适你数据库布局
";
smsg=smsg+"5.依据语句查询了局或实行命令
";
alert(smsg);}
elseif(x==1){
smsg="SELECTcolumnName1,columnName2
";
smsg=smsg+"FROMtableName
";
smsg=smsg+"WHEREcolumnName=value
";
document.main.sql.value=smsg;
}
elseif(x==2){
smsg="INSERTINTOtableName
";
smsg=smsg+"(columnName,IntegerColumnName)
";
smsg=smsg+"VALUES(value,numericValue)
";
document.main.sql.value=smsg;
}
elseif(x==3){
smsg="UPDATEtableName
";
smsg=smsg+"SETcolumnName=value
";
smsg=smsg+"WHEREcolumnName=value
";
document.main.sql.value=smsg;
}
elseif(x==4){
smsg="DELETEcolumnName
";
smsg=smsg+"FROMtableName
";
smsg=smsg+"WHEREcolumnName=value
";
document.main.sql.value=smsg;
}
elseif(x==5){
smsg="CREAT</p>ASP在国内异常流行,因为国内大多使用的是盗版的Windows和盗版的SQLServer,而ASP+COM+SQLServer实际上也是一种不错的搭配,其性能也不输于PHP+MYSQL,特别是Windows系统和SQLServer都有图形界面,比APACHE和MYSQL易于维护,因此对于不重视知识产权的国家来说也是一种不错的选择。 |
|