Automatic generation of SQL database installation source program with ASP

Source: Internet
Author: User
Tags create index
Program | data | Database chinaasp Forum full program Download:
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
Because I installed MSDE, no Query Analyzer, no way to run the SQL file, I am looking for the SQL of the disc is not found, bitter
Annoyed a good Chen Zi. You can only create a new database in the export import (oh, found in ms.net can actually edit view SQL data
Library, although also can not run SQL, but gave me a lot of convenience, this write an ASP file. Fully-automated generation of chinaasp SQL
Database. </P><P> go to chinaasp don't feel what, now really untie his content a look, really impressive, it is fine in the boutique. No wonder so
Many people imitate and enjoy. </P><P> If you have Query Analyzer, this is also very convenient to use, if you do not Query Analyzer, it is better, where the connection of SQL
May be changed by someone, can not use, I have changed the good. </P><P> If you write another Sol database later, just open conn.asp and setup.asp. Dots is, in short, handwritten.
Things, with a special comfort. </P><P> statement: As if Chinaasp does not provide a free use of the authorization, I am not quite clear, this is purely personal research, can not really take it
or changed. </p><p>conn. ASP file:
<%
Dim conn
Dim connstr
Connstr= "Driver={sql server};server=localhost; Uid=sa; pwd=;d Atabase=bbsbbs "
Set Conn=server.createobject ("ADODB. CONNECTION ")
If Err.Number <> 0 Then
Err.Clear
Set conn=nothing
Response.Write "Create ADO object Failed"
Response.End
Else
Conn.Open ConnStr
If Err Then
Err.Clear
Set conn=nothing
Response.Write "SQL database connection failed, check if the database exists, and ODBC exists"
Response.End
End If
End If </p><p>sub endconnection ()
Conn.close
End Sub
%></p><p>setup.asp file:
!--#include file= "conn.asp"-->
<style type= "Text/css"
!--
body{
Background:white;
Font-family: Song body;
font-size:75%
}
-->
</STYLE>
<title> chinaasp Installation </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 () 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 () 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 (MB) 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 (+) 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 () 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 () 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 nvarchar () NULL,"
strSQL =strsql + "hits int NULL,"
strSQL =strsql + "Length int NULL,"
strSQL =strsql + "emote int NULL,"
strSQL =strsql + "keywords nvarchar (255) NULL"
strSQL =strsql + ")"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE TABLE site" ("
strSQL =strsql + "sitemasterpwd nvarchar (m) NULL"
strSQL =strsql + ")"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE TABLE [user] ("
strSQL =strsql + "UserID int IDENTITY (1, 1) not NULL,"
strSQL =strsql + "UserName nvarchar () NULL,"
strSQL =strsql + "useremail nvarchar (255) NULL,"
strSQL =strsql + "UserPassword nvarchar (one) NULL,"
strSQL =strsql + "ICQ nvarchar () NULL,"
strSQL =strsql + "homepage nvarchar (255) NULL,"
strSQL =strsql + "sex nvarchar (a) NULL,"
strSQL =strsql + "passanswer nvarchar (MB) NULL,"
strSQL =strsql + "Incometime smalldatetime NULL,"
strSQL =strsql + "Birthday smalldatetime NULL,"
strSQL =strsql + "points int NULL,"
strSQL =strsql + "visits int NULL,"
strSQL =strsql + "country nvarchar () NULL,"
strSQL =strsql + "city nvarchar () NULL,"
strSQL =strsql + "passquest nvarchar (MB) NULL,"
strSQL =strsql + "signature nvarchar (255) NULL,"
strSQL =strsql + "disabled int NULL"
strSQL =strsql + ")"
Set adors = Conn.execute (strSQL) </p><p>strsql = "ALTER TABLE [boardcate] with NOCHECK ADD CONSTRAINT [Pk_board Cate] PRIMARY KEY CLUSTERED ([id])
Set adors = Conn.execute (strSQL) </p><p>strsql = "ALTER TABLE [announce] with NOCHECK ADD CONSTRAINT [Df__annou nce__replym__3f466844] DEFAULT (0) for [Replymail], "
strSQL =strsql + "CONSTRAINT [pk_announce] PRIMARY KEY nonclustered ([Announceid])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "ALTER TABLE [board] with NOCHECK ADD CONSTRAINT [Pk_board] PRI MARY KEY nonclustered ([Boardid])
Set adors = Conn.execute (strSQL) </p><p>strsql = "ALTER TABLE [essence] with NOCHECK ADD CONSTRAINT [pk_essence ] PRIMARY KEY nonclustered ([id])
Set adors = Conn.execute (strSQL) </p><p>strsql = "ALTER TABLE [user] with NOCHECK ADD CONSTRAINT [Df_user_disab LED] DEFAULT (0) for [disabled], "
strSQL =strsql + "CONSTRAINT [Pk_user] PRIMARY KEY nonclustered ([UserID])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [Boardid] on [announce] ([Boardid])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [Announce0] on [announce] ([Boardid], [ Announceid], [ParentID]) "
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [Ix_announce] on [announce] ([orders])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [announce00] on [announce] ([Rootid], [Boardid] , [orders]) "
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [ix_boardcate] on [Boardcate] ([Orders])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [Boardid] on [Essence] ([Boardid])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [points] on [user] ([points])"
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [username] on [dbo]." [User] ([UserName]) "
Set adors = Conn.execute (strSQL) </p><p>strsql = "CREATE INDEX [Ix_user] on [dbo]." [User] ([UserName]) "
Set adors = Conn.execute (strSQL) </p><p>strsql = "Insert site (SITEMASTERPWD) VALUES (' 12345 ')"
Set adors = Conn.execute (strSQL) </p><p>strsql = "ALTER TABLE announce add lock bit not NULL DEFAULT (0)"
Set adors = Conn.execute (strSQL) </p><p>%></p><p> <p> </p>
<p> The operation was successful, please do not repeat the installation in the same database, <a Href= "DEFAULT. ASP "target=" "_blank" > Please login forum </a> <br>
<br>
<br>
<a Href= "admin" target= "_blank" the admin password has been set to 12345 for you, please login Admin page </a> </p>
<%
Else
Response.Write ("<a href=setup.asp?setup=yes> Click here to start installing </a> <br> <br> <br> <a Href=" "Http://www.yescnet.com" > A crane's chinaasp Forum Database installer </a> ")
End If
%>
<p align= "Center" > <br>
<a Href= "http://www.yescnet.com" target= "_blank" A Crane chinaasp Forum database installer </a> | |
<a Href= "http://www.yescnet.com" >cnet Chinese network </a> | | <a Href= "Http://www.yescnet.com" >www.yescnet.com </a> </p>
</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.