www.gusucode.com > 运动用品商城网站系统源代码程序 > stat/sAdmin_cdb.asp
<!--#include file="inc_config.asp"--> <!--#include file="inc_conn.asp"--> <!--#include file="inc_Lang_admin.asp"--> <!--#include file="style/style_all.asp"--> <!--#include file="inc_admin_functions.asp"--> <% dim CanOpt,sStep,tTitle,tMainName tTitle = Lang_sAdmin_Me & "-" & Lang_cdb tMainName = Lang_cdb ostr="":ostr2="":ostr3="":ostr4="" ' 得到老结构 set rs=conn.execute("select * from bigsite") set rsf=rs.fields for i= 0 to rsf.count-1 if i<>0 then ostr = ostr & "," ostr = ostr & rsf(i).name next set rs=nothing conn.close set conn=nothing call openconn ' 修改结构 ostr2 = "," & lcase(ostr) & "," if instr(ostr2,",b_today,")=0 then conn.execute("ALTER TABLE Bigsite ADD COLUMN B_Today INTEGER") ostr3=ostr3 & replace(Lang_cdb_3,"$c","B_Today") & "<br>" conn.execute "update bigsite set B_Today=0" end if if instr(ostr2,",b_yesterday,")=0 then conn.execute "ALTER TABLE Bigsite ADD COLUMN B_Yesterday INTEGER" ostr3=ostr3 & replace(Lang_cdb_3,"$c","B_Yesterday") & "<br>" conn.execute "update bigsite set B_Yesterday=0" end if if ostr3="" then ostr3=Lang_cdb_2 & "<br>" ' 得到新结构 set rs=conn.execute("select * from bigsite") set rsf=rs.fields for i= 0 to rsf.count-1 if i<>0 then ostr4 = ostr4 & "," ostr4 = ostr4 & rsf(i).name next ' 输出结果 Response.Write replace(Style_Header,"$Title",tTitle) Response.Write replace(Style_Admin_Top,"$Lang_Admin",Lang_sAdmin_Me) Response.Write replace(Style_MainTop,"$MainName",tMainName) Response.Write "<table width=""90%"" align=""center""><tr><td>" Response.Write Lang_cdb_0 & ":<br>" & ostr & "<br><br>" Response.Write ostr3 & "<br>" Response.Write Lang_cdb_1 & ":<br>" & ostr4 & "<br><br>" Response.Write Lang_cdb_6 & "<br>" Response.Write "</td></table>" Response.Write Style_MainBottom Response.Write Style_Bottom %>