access數據庫教程連接代碼
dim conn,connstr,timesdb,rs
timesdb="../www.111cn.net/#tsm_admin_data.asp"
connstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(""×db&"")
'on error resume next
set conn = server.createobject("adodb.connection")
conn.open connstr
if err then
err.clear
set conn = nothing
response.write "<center>數據庫連接錯誤,請檢查conn.asp文件連接字符串!</center>"
response.end
end if
set rs=server.createobject("adodb.recordset")