<%
Response.buffer=True
Server.ScriptTimeOut = 999
on Error Resume Next

dim db,connstr,conn

Const DataType="ACCESS"
If DataType="ACCESS" then
    db="/ask/data/#mydata.mdb"
    connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(db)
Else
    connstr = "Provider = Sqloledb; User ID = kuaiwen; Password = kuaiwen; Initial Catalog = kuaiwen; Data Source = 127.0.0.1;"
End if
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr

if err then
response.Write("连接数据库出错,请检查!")
response.End()
end if

sub closedb()
conn.close
set conn=nothing
end sub
%>