<%@ LANGUAGE = VBScript CodePage = 936%>
<%
'option explicit
Dim conn,db
Response.Buffer = true
'定义数据库类别，1为SQL数据库，0为Access数据库
Const isSqlDataBase = 0
Dim ConnStr
If IsSqlDataBase = 1 Then
	'-----------------------SQL数据库连接参数-------------------------------------
	Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
	SqlDatabaseName = "xuanxi"     '数据库名
	SqlPassword = "xuanxi"          '用户密码
	SqlUsername = "xuanxi"          '用户名
	SqlLocalName = "(local)"        '连接名（本地用local，外地用IP）
	ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
	'-----------------------------------------------------------------------------
Else
	'-----------------------ACCESS数据库连接--------------------------------------
	'ACCESS数据库连接
	db = "softdown.mdb"   '要升级的Access数据库名称
	Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
	'------------------------------------------------------------------------------
End If
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
If Err Then
	err.Clear
	Set Conn = Nothing
	Response.Write "数据库连接出错，请检查连接字串。"
	Response.End
End If
%>