22,301
社区成员




<%
Dim objConn
'on error resume next
call conn_init()
sub conn_init()
'on error resume next
Set objConn=Server.CreateObject("ADODB.Connection")
ConnectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Database"
if err.number<>0 then
err.clear
set objconn=nothing
response.write "数据库连接出错!"
Response.End
else
objConn.Open ConnectionString
if err then
err.clear
set objconn=nothing
response.write "数据库连接出错!"
Response.End
end if
end if
end sub
'close database
sub endConnection()
objconn.close
set objconn=nothing
end sub
%>