|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
因为ASP脚本语言非常简单,因此其代码也简单易懂,结合HTML代码,可快速地完成网站的应用程序。还无法完全实现一些企业级的功能:完全的集群、负载均横。access|程序|数据|数据库<%
---defineDSNnamesinarray
---enteroneormoreDSNnameinthedatabase_listarray
database_list=Array("Test","test1")
---enabledeletingtable?--Carefull!!
strEnableDeleteTable=False
----enddeclaration
----donotchangecodebelowthisline---------------------------------------------
field_value=Array("Integer","Double","char(255)","Memo","Date","Currency","YesNo")
field_display=Array("Integer","Number","Text","Memo","Date/Time","Currency","Yes/No")
dsn_name=Request("DatabaseName")
IfNotdsn_name=""Then
Setcon=Server.CreateObject("ADODB.Connection")
Con.Provider="sqloledb"
ifdsn_name="Test"then
ConStr="DataSource=127.0.0.1;InitialCatalog=test;UserID=test;Password=1111"
else
ConStr="DataSource=127.0.0.1;InitialCatalog=test1;UserID=test1;Password=1111"
endif
con.Openconstr
EndIf
table_name=Request("TableName")
IfRequest("AddNewTable")""Then
IfRequest("NewTableName")""Then
SQL="CREATETABLE"&Request("NewTableName")&"(fldAutoCounter)"
con.Execute(SQL)
EndIf
EndIf
IfRequest("AddNewField")""Then
Ifrequest("NewFieldName")""Then
SQL="ALTERTABLE"&table_name&"ADD"&request("NewFieldName")&""&request("NewFieldType")&"NULL"
con.Execute(SQL)
EndIf
EndIf
IfRequest("DeleteTable")""Then
SQL="DROPTABLE"&Request("TableName")
Con.Execute(SQL)
EndIf
IfRequest("DeleteColumn")""Then
ForEachitemInRequest("DeleteCol")
SQL="ALTERTABLE"&Request("TableName")&"DROP"&item
con.Execute(SQL)
Next
EndIf
-----filename--------------------------------------------------------
file=Request.ServerVariables("SCRIPT_NAME")
file=strReverse(file)
pos=Instr(file,"/")
file=Left(file,pos-1)
file=strReverse(file)
%>
<%
response.write"<!DOCTYPEHTMLPUBLIC""-//W3C//DTDHTML3.2Final//EN"">"
response.write"<HTML><HEAD><TITLE>DatabaseControl</TITLE></HEAD>"
response.write"<BODYbgcolor=""#FFFFFF""><br><br><center>"
------------------------------------------------------------
response.write"<formaction="""&file&"""method=post>"
response.write"<b><fontface=verdanasize=3color=""#008080""><u>TotalDatabaseControl</u></font></b><br><br>"
response.write"<fontface=Verdana,Arialsize=2><b>DatabaseName:</b></font>"
response.write"<selectname=""databasename"">"
Fori=0touBound(database_list)
Ifdatabase_list(i)=Request("databasename")Then
response.write"<optionvalue="""&database_list(i)&"""selected>"&database_list(i)
Else
response.write"<optionvalue="""&database_list(i)&""">"&database_list(i)
EndIf
Next
response.write"</select>"
response.write"<inputtype=submitname=GoData</p>楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。 |
|