有人让我改一下 conn.asp 里面链接网站数据库 ,但是我没数据库怎么修改?
源码里还有个conn.asp.bak 的文件里面也有设置 数据库用户名的这个需要修改吗?
conn.asp源码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Option Explicit
Response.Buffer = True
Response.Charset = "utf-8"
Dim Startime
Dim SqlNowString,DaluShop,template,MyBoardOnline,query,rs,rs_xml,rs_count,TPL_Name,ishtml
Dim MyConn,Plus_Conn,Db,MyDbPath,SqlQueryNum,BaseUrl,BaseUrlToPage,RealUrl,cookiename
Dim Conn
Const fversion="7.1.0 Sp1"
Const EnabledSession= True
Startime = Timer()
'系统采用XML版本设置
'最高版本为.4.0 依次为: Const MsxmlVersion=".3.0" Const MsxmlVersion=".2.6" 最低版本Const MsxmlVersion=""
Const MsxmlVersion=".3.0"
'可修改设置一:========================定义数据库类别,1为SQL数据库,0为Access数据库=========================
Const IsSqlDataBase = 0
MyDbPath = ""
'=====================================================================================================
If IsSqlDataBase = 1 Then
'必修改设置二:========================SQL数据库设置=====================================================
'sql数据库连接参数:数据库名(SqlDatabaseName)、用户密码(SqlPassword)、用户名(SqlUsername)、
'连接名(SqlLocalName)(本地用local,外地用IP)
Const SqlDatabaseName = "56214"
Const SqlPassword = "zax860118"
Const SqlUsername = "zax860118"
Const SqlLocalName = "(76.73.64.154)"
'=====================================================================================================
SqlNowString = "GetDate()"
Else
'必修改设置三:========================Access数据库设置==================================================
'免费用户第一次使用请修改本处数据库地址并相应修改data目录中数据库名称,如:将DaluShop6.mdb修改为DaluShop6.asp
Db = "bbs/database/WoDig2007.mdb"
'=====================================================================================================
SqlNowString = "Now()"
End If
Const IsDeBug = 0
Const ShowSQL = 0
ishtml = 0
SqlQueryNum = 0
cookiename = Request.Cookies("dalu")("username")
'Set DaluShop = New Cls_Forum
'Set template = New cls_templates
Sub ConnectionDatabase
Dim ConnStr
If IsSqlDataBase = 1 Then
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Else
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & db)
End If
On Error Resume Next
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.open ConnStr
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open ConnStr
If Err Then
err.Clear
Set MyConn = Nothing
Response.Write "DataBase Connect Wrong!"'注释,需要把这几个字翻译成英文。
Response.End
End If
End Sub
sub getBaseUrl(RealUrl)
dim temp,j
BaseUrl = "http://"&request.ServerVariables("HTTP_HOST")
temp = split(request.ServerVariables("PATH_INFO"),"/")
for j = 1 to (ubound(temp)-1-instr(RealUrl,"../"))
BaseUrl = BaseUrl&"/"&temp(j)
next
BaseUrlToPage = BaseUrl&"/"
BaseUrl = replace(BaseUrl & "/template/" & TPL_Name & "/",MyDbPath,"")
BaseUrl = "<base href="&BaseUrl&" />"
end sub
Function GetTplName
Set Rs = conn.execute("SELECT tpl_name FROM webconfig")
GetTplName = Rs(0)
End Function
%>