oconn.asp
来自「Very good-xuan yen Student Information M」· ASP 代码 · 共 34 行
ASP
34 行
<%
Dim oConn
If Not IsObject(oConn) Then Call DBConnBegin()
Sub DBConnBegin()
If IsObject(oConn) Then Exit Sub
Dim dbFilePath,dbFileName
dbFileName = DBP
dbFilePath = Server.MapPath(dbFileName)
Set oConn = Server.CreateObject("ADODB.Connection")
On Error Resume Next
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFilePath
If Err Then
Call ShowErrs()
End If
End Sub
Sub CloseConn()
on error resume next
if isobject(MyPage) then
set MyPage = Nothing
end if
if Isobject(objrs) then
objrs.close()
set objrs = nothing
end if
If IsObject(oConn) Then
oConn.Close
Set oConn = Nothing
End If
if err then err.clear
End Sub
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?