日期:2013-03-21  浏览次数:20992 次

chinaasp论坛完整程序下载:
http://www.yescnet.com/manage.asp?url=down/list.asp**id=89
http://user.7host.com/yescnet/manage.asp?url=down/list.asp**id=90
因为我装的是MSDE,没有发现查询分析器,也没办法运行sql文件,我到处支找SQL的光盘也找不到,苦
恼了好一陈子。只能在导出导入里新建一个数据库(呵呵,发现在ms.net里居然可以编辑查看sql数据
库,虽然也不能运行sql,不过给了我不少方便),就此写了一个ASP文件。全自动的生成chinaasp的sql
数据库。</P><P>去chinaasp不觉得什么,现在真正解开他的内容一看,真的令人叹服,委实是精品中的精品。难怪这么
多人效仿而乐此不疲。</P><P>如果你有查询分析器,这个用一下反正也很方便,如果你没有查询分析器,那是更好了,其中连接SQL的
可能是被人改了,不能用,我都改好了。</P><P>以后如果写其他的SOL数据库,只要打开conn.asp与setup.asp。依样画葫芦就是了,总之自已手写出来的
东西,用得特舒服。</P><P>声明:好象chinaasp不提供免费使用的授权,我也不太清楚,这个纯粹是个人研究,不可以真的拿去用了
或改了。</P><P>CONN.ASP文件:
<%
dim conn
dim connstr
connstr="driver={SQL Server};server=localhost;UID=sa;PWD=;database=bbsbbs"
set conn=server.createobject("ADODB.CONNECTION")
if err.number<>0 then
err.clear
set conn=nothing
Response.Write "创建ADO对象失败"
Response.End
else
conn.open connstr
if err then
err.clear
set conn=nothing
Response.Write "SQL数据库连接失败,请检查数据库是否存在,以及odbc是否存在"
Response.End
end if
end if </P><P>sub endConnection()
conn.close
end sub
%></P><P>setup.asp文件:
<!--#include file="conn.asp"-->
<html>
<STYLE TYPE="text/css">
<!--
body{
BACKGROUND: white;
FONT-FAMILY: 宋体;
FONT-SIZE: 75%
}
-->
</STYLE>
<title>chinaasp安装</title><body>
<%</P><P>If Request.QueryString("setup") = "yes" Then</P><P>on error resume next</P><P>Set adoRS = Server.CreateObject("ADODB.Recordset")</P><P>strSQL = "CREATE TABLE Announce ( "
strSQL =strSQL +"AnnounceID int IDENTITY (1, 1) NOT NULL ,"
strSQL =strSQL +"ParentID int NULL , "
strSQL =strSQL +"Child int NULL , "
strSQL =strSQL +"BoardID int NULL , "
strSQL =strSQL +"UserName nvarchar (50) NULL , "
strSQL =strSQL +"UserEmail nvarchar (255) NULL , "
strSQL =strSQL +"URL nvarchar (255) NULL , "
strSQL =strSQL +"URLTitle nvarchar (255) NULL , "
strSQL =strSQL +"URLPic nvarchar (255) NULL , "
strSQL =strSQL +"Topic nvarchar (255) NULL , "
strSQL =strSQL +"Body ntext NULL , "
strSQL =strSQL +"DateAndTime datetime NULL , "
strSQL =strSQL +"hits int NULL , "
strSQL =strSQL +"length int NULL , "
strSQL =strSQL +"RootID int NULL , "
strSQL =strSQL +"layer int NULL , "
strSQL =strSQL +"orders int NULL , "
strSQL =strSQL +"emote int NULL , "
strSQL =strSQL +"ip nvarchar (20) NULL , "
strSQL =strSQL +"signature nvarchar (255) NULL , "
strSQL =strSQL +"replyMail bit NOT NULL "
strSQL =strSQL +") "
Set adoRS = Conn.Execute(strSQL)</P><P>strSQL ="CREATE TABLE board ("
strSQL =strSQL +"BoardID int IDENTITY (1, 1) NOT NULL , "
strSQL =strSQL +"BoardName nvarchar (100) NULL ,"
strSQL =strSQL +"BoardMaster int NULL , "
strSQL =strSQL +"BoardMaster2 int NULL , "
strSQL =strSQL +"BoardMaster3 int NULL , "
strSQL =strSQL +"cateID int NULL , "
strSQL =strSQL +"description nvarchar (500) NULL "
strSQL =strSQL +") "
Set adoRS = Conn.Execute(strSQL)</P><P>strSQL ="CREATE TABLE boardCate ("
strSQL =strSQL +"id int IDENTITY (1, 1) NOT NULL , "
strSQL =strSQL +"CateName nvarchar (50) NOT NULL , "
strSQL =strSQL +"Description nvarchar (244) NULL , "
strSQL =strSQL +"Orders int NULL "
strSQL =strSQL +") "
Set adoRS = Conn.Execute(strSQL)</P><P>strSQL ="CREATE TABLE essence ("
strSQL =strSQL +"id int IDENTITY (1, 1) NOT NULL , "
strSQL =strSQL +"announceid int NULL , "
strSQL =strSQL +"boardid int NULL , "
strSQL =strSQL +"username nvarchar (