欢迎大家光临【无师自通-教程网】您的到来是我们的荣幸。本站提供photoshop教程,ps教程,flash教程,cad教程,网页制作教程,excel教程,asp教程,vb教程,3d教程,c语言教程,html教程,coreldraw教程,dreamweaver教程,java教程,3dmax教程 等各种教程为主题的内容和服务,相信您会在这里找到您所需要的东东。无师自通伴您一生-谢谢您的光临!!
网站地图 设为首页
简繁切换 加入收藏
栏目待定 留言本站
您现在的位置: 无师自通-教程网 >> WEB开发 >> Asp教程 >> ASP应用 >> 教程正文

  没有公告

教程: ASP教程-ASP应用-用ASP自动生成SQL数据库的安装源程序 更多...
教程: ASP教程-ASP应用-用ASP自动生成SQL数据库的安装源程序
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 (50) NULL , "
strSQL =strSQL "useremail nvarchar (255) NULL , "
strSQL =strSQL "url nvarch

[1] [2] [3] 下一页

教程录入:admin    责任编辑:admin 
  • 上一篇教程:

  • 下一篇教程: 没有了
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     
     
     
     

    asp连接mysql数据库

    asp连接mysql数据库-2

    frontpage2000教程---制作主页
    免责声明!本站资料大部分来自于互联网,其版权归原作者或其他合法者所有.如内容涉及或侵犯了您的权益,请通知本人,我将尽快处理!.欢迎您的光临。
    辽ICP备07003958号
    无师自通,伴你一生-教程网