www.gusucode.com > 运动用品商城网站系统源代码程序 > stat/inc_conn.asp
<% public conn public DBPath sub openconn on error resume next set conn=server.createobject("adodb.connection") 'conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath DBPath = Server.MapPath( CFG_Connpath ) err=0 conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath if err<>0 then response.write "<font color=red><b>Error!</b></font><br>There was an error when the system try to open the database." response.end end if end sub call openconn sub closeconn conn.Close set conn=nothing end sub %>