CONN连接数据库避免错误

asp

2008-09-29 15:26

<%

on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db/#cn.mdb")
conn.CommandTimeOut=999
if err then
response.Write("数据库连接错误!请联系管理员!")
response.End()
end if

%>