最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 数据库连接与关闭程序
时间:2022-06-30 10:09:34 编辑:袖梨 来源:一聚教程网
Public Function DbOpen()
If IsObject(Conn) Then Exit Function
Set Conn = Server.CreateObject(Cfg.nConnectionObject)
If Conn.State = 1 Then Exit Function
On Error Resume Next
Conn.Open ConnStr
If Err.Number Then
ErrorInfo = Err.Description
Err.Clear
Set Conn = Nothing
Response.Write "
错误源:
数据库连接错误
错误描述:
" & ErrorInfo & ""
Response.Write "
Response.End()
End If
End Function
Public Function DbClose()
If Not IsObject(Conn) Then Exit Function
If Conn.State = 0 Then Exit Function
Conn.Close:Set Conn = Nothing
End Function
'函数:创建数据库RecordSet对象
'参数:链接串
Public Function RecordSet(obj)
Set obj = Server.CreateObject(Cfg.nRecordSetObject)
End Function