<%
'Option Explicit
Response.Buffer = True
Dim Conn,Db
'可修改设置一：========================定义数据库类别，1为SQL数据库，0为Access数据库=============================
Const IsSqlDataBase = 0
If IsSqlDataBase = 1 Then
	'必修改设置二：========================SQL数据库设置=============================================================
	'sql数据库连接参数：数据库名(SqlDatabaseName)、用户密码(SqlPassword)、用户名(SqlUsername)、
	'连接名(SqlLocalName)（本地用local，外地用IP）
	Const SqlDatabaseName = "sjjd"
	Const SqlPassword = "as"
	Const SqlUsername = "sa"
	Const SqlLocalName = "(local)"
	'================================================================================================================
Else
	'必修改设置三：========================Access数据库设置==========================================================
	Db = "../../web08data/#web08#.mdb"
End If

Sub ConnDB
	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(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 "数据库连接出错，请检查连接字串。"&ConnStr '注释，需要把这几个字翻译成英文。
		Response.End
	End If
End Sub

Sub CloseDB
	conn.close
	Set Conn=Nothing
End Sub

conndb
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 
a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none }
.pad {
	PADDING-LEFT: 2px
}
</style>
 

 
 

