?? conn.asp
字號(hào):
<%
dim conn
dim connstr
'on error resume next
call conn_init()
sub conn_init()
'on error resume next
connstr = "DBQ=" + server.mappath("../data.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err.number<>0 then
err.clear
set conn=nothing
response.write "數(shù)據(jù)庫連接出錯(cuò)!"
Response.End
else
'response.write connstr
conn.open connstr
if err then
err.clear
set conn=nothing
response.write "數(shù)據(jù)庫連接出錯(cuò)!"
Response.End
end if
end if
end sub
sub endConnection()
conn.close
set conn=nothing
end sub
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -