<%
dim conn
set conn=server.createobject("adodb.connection")  
conn.ConnectionTimeout=20                      
conn.open "driver={SQL Server};server=www.yclife.cn;uid=0359;pwd=0359;database=0359"
If Err Then
	err.Clear
	Set Conn = Nothing
	Response.Write "数据库连接出错，请检查连接字串。"
	Response.End
End If
Function CloseDatabase()
  conn.Close
  Set conn=Nothing
End Function

dim connstrItem
dim dbItem
dim connItem
dbItem="/admin/database/2009life.mdb"      '采集数据库文件的位置 
'On Error Resume Next
Set connItem = Server.CreateObject("ADODB.Connection")
connstrItem="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dbItem)
connItem.Open connstrItem
If Err Then
   err.Clear
   Set ConnItem = Nothing
   Response.Write "采集数据库连接出错，请检查连接字串。"
   Response.End
End If

Sub CloseConnItem()
   On Error Resume Next
   ConnItem.close
   Set ConnItem=nothing
End sub
%>