<%@ LANGUAGE = VBScript CodePage = 936%>
<%
Option Explicit
Dim startime,Conn,db
Response.Buffer = True
startime = Timer()
'--定义数据库类别，1为SQL数据库，0为Access数据库
Const isSqlDataBase = 0
Dim NowString
Dim ConnStr

If IsSqlDataBase = 1 Then
	'-----------------------SQL数据库连接参数---------------------------------------
	Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
	NowString = "GetDate()"
	SqlDatabaseName = "newasp"     '数据库名
	SqlUsername = "sa"          '用户名
	SqlPassword = "newasp"          '用户密码
	SqlLocalName = "(local)"        '连接名（本地用local，外地用IP）
	ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
	'-------------------------------------------------------------------------------
Else
	'-----------------------ACCESS数据库连接----------------------------------------
	NowString = "Now()"
	'ACCESS数据库连接,请使用根路径或者绝对路径
	db = "\database\#newasp.mdb"
	Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ChkMapPath(db)
	'-------------------------------------------------------------------------------
End If

Dim DBPath
'-- 采集数据库连接路径
DBPath = "/database/#Collection.mdb"		'-- 请用根相对路径

Sub ConnectionDatabase()
	On Error Resume Next
	Set Conn = Server.CreateObject("ADODB.Connection")
	Conn.Open Connstr
	If Err Then
		Err.Clear
		Set Conn = Nothing
		Response.Write "数据库连接出错，请打开conn.asp文件检查连接字串。"
		Response.End
	End If
End Sub
Sub CloseConn()
	On Error Resume Next
	If IsObject(Conn) Then
		Conn.Close
		Set Conn = Nothing
	End If
	Set Newasp = Nothing
End Sub
%>