日期:2014-05-16 浏览次数:21428 次
<%
On Error Resume Next
'---------------------数据库类型及路径定义---------------------
'Function OpenDatabase
dim conn,connstr
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;"& _
"Data Source = " & Server.MapPath("/Data/suomap.mdb") & ";"
set conn=Server.CreateObject("adodb.connection")
conn.open connstr
If Err Then
err.Clear
Set Conn = Nothing
'Response.Write(connstr)
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
'End Function
sub close_conn()
conn.close
set conn=nothing
end sub
%>